terminalViewContainer is now an observable object

made the session list view more pretty
terminalviewcontaner has a static shared property which is an instance of itself
then it has sessions inside with a dict of uuid:terminalcontainer inside
hostsview is in the section "hosts"
This commit is contained in:
neon443
2025-06-29 16:25:49 +01:00
parent 331a921499
commit 8e69dfc165
9 changed files with 82 additions and 48 deletions

View File

@@ -15,6 +15,9 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
private var session: ssh_session?
private var channel: ssh_channel?
@MainActor var container: TerminalViewContainer {
TerminalViewContainer.shared
}
var sessionID: UUID?
var scrollback: [String] = []
@@ -140,7 +143,7 @@ class SSHHandler: @unchecked Sendable, ObservableObject {
if let sessionID {
Task { @MainActor in
TerminalViewContainer.shared.removeValue(forKey: sessionID)
container.sessions.removeValue(forKey: sessionID)
self.sessionID = nil
}
}