migueldeicaza / SwiftTermApp

MIT License
305 stars 29 forks source link

Rethink TerminalView rehosting #73

Open migueldeicaza opened 3 years ago

migueldeicaza commented 3 years ago

Currently the TerminalView rehosting can cause a crash in SwiftUI (this is worked-around for now, but it was tracked as issue #60). And while there is a workaround, a better design is probably warranted.

The Terminal generally tracks most of the terminal state, and TerminalView has a little bit of UI-level state. Independelty of this, SSH-capabilities were added in a subclass.

The idea would be to create as many TerminalView UIViews as necessary, which are only views into the underlying Terminal.

The reality is a bit more complicated due to SSH and the class hierarchy in place.

Perhaps the UIView state from TerminalView and the SSH state from SshTerminalView need to be moved out, the former into a TerminalViewSettings and the latter as being a separate capability. So that we could create as many TerminalViews as desired that are all just visual representations of the underlying Terminal+SSH connection state.