mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user