typing works
so basically it just stopped tryna read from the server once the server was silent for a sec
so then i removed the return and made it an optional if let and wait 10_000 us if nothing comes back
this is so goood

changed it to get 256 bytes from server
This commit is contained in:
neon443 committed 2025-06-22 19:32:42 +01:00
1 parent 9338b46760
commit 71c8e3f891
3 files changed
+12 -8

No files matched your search

+2 -2
View File
@@ -315,7 +315,7 @@ class SSHHandler: ObservableObject {
guard ssh_channel_is_open(channel) != 0 else { return nil }
guard ssh_channel_is_eof(channel) == 0 else { return nil }
var buffer: [CChar] = Array(repeating: 0, count: 16)
var buffer: [CChar] = Array(repeating: 0, count: 256)
let nbytes = ssh_channel_read_nonblocking(channel, &buffer, UInt32(buffer.count), 0)
guard nbytes > 0 else { return nil }
@@ -350,6 +350,6 @@ class SSHHandler: ObservableObject {
guard ssh_channel_is_eof(channel) == 0 else { return }
ssh_channel_change_pty_size(channel, Int32(toCols), Int32(toRows))
print("resized tty to \(toRows)rows and \(toCols)cols")
// print("resized tty to \(toRows)rows and \(toCols)cols")
}
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.