switched while loop out for a guard to break the loop

This commit is contained in:
neon443
2025-07-03 12:36:27 +01:00
parent 4f7b948fa4
commit ddad89b0e2

View File

@@ -71,8 +71,8 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
//TODO: check hostkey
while state != .authorized {
for method in getAuthMethods() {
guard state != .authorized else { break }
switch method {
case .password:
do { try authWithPw() } catch {
@@ -92,7 +92,6 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
disconnect()
}
}
}
ssh_channel_request_env(channel, "TERM", "xterm-256color")
ssh_channel_request_env(channel, "LANG", "en_US.UTF-8")