mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
fix disconnect if u leave it idle for a min
dont restore scrollback on init
This commit is contained in:
@@ -19,14 +19,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
self.handler = handler
|
self.handler = handler
|
||||||
self.hostsManager = hostsManager
|
self.hostsManager = hostsManager
|
||||||
|
|
||||||
print(getTerminal().backgroundColor.colorCodable)
|
|
||||||
print(getTerminal().foregroundColor.colorCodable)
|
|
||||||
|
|
||||||
applySelectedTheme()
|
applySelectedTheme()
|
||||||
Task {
|
|
||||||
await restoreScrollback()
|
|
||||||
// await startFeedLoop()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func restoreScrollback() {
|
func restoreScrollback() {
|
||||||
@@ -46,7 +39,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
func startFeedLoop() {
|
func startFeedLoop() {
|
||||||
Task {
|
Task {
|
||||||
guard let handler else { return }
|
guard let handler else { return }
|
||||||
while handler.connected {
|
while checkShell(handler.state) {
|
||||||
if let read = handler.readFromChannel() {
|
if let read = handler.readFromChannel() {
|
||||||
await MainActor.run {
|
await MainActor.run {
|
||||||
self.feed(text: read)
|
self.feed(text: read)
|
||||||
@@ -55,7 +48,7 @@ final class SSHTerminalDelegate: TerminalView, Sendable, @preconcurrency Termina
|
|||||||
try? await Task.sleep(nanoseconds: 10_000_000) //10ms
|
try? await Task.sleep(nanoseconds: 10_000_000) //10ms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handler.disconnect()
|
print("task end?")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user