Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reinstate gowid Screen's support for activation and deactivation
We recently merged changes to help with a gowid use case where an application wanted to provide its own tcell Screen object and not use the one gowid creates. In doing so, I inadvertently broke correct screen activation and deactivation. Activation means that the terminal screen is taken over by the tcell screen, and deactivation means control is given back and in practice the terminal screen's contents will return to their appearance before the screen was activated. For example, in termshark, if the user listens on an interface, termshark's UI will not start right away, displaying: (The termshark UI will start when packets are detected on eth0...) It behaves like this in case listening on an interface requires superuser permissions, which tshark will request - so this lets the user see that prompt without the UI covering it up. When packets arrive, termshark activates the tcell screen and the UI appears. If the user hits ctrl-z, termshark deactivates the screen and sends itself a SIGSTOP. This lets the user see what was on the terminal before termshark launched. Emacs in the terminal behaves the same way and I copied that. I lost this behavior with recent gowid updates and didn't spot it until recently. The fix here is to reinstate the DontActivate bool to the App's options, but to only make use of it if the user does not supply their own screen. If the gowid app passes its own tcell screen to the gowid App, then ActivateScreen and DeactivateScreen should not be used.
- Loading branch information