Detect whether the session is "safe" to attach/detach #5
Labels
Target: Core 💥
Core architectural support library
Target: Plug-in architecture 🔌
Features that should be implemented with a pluginable callback architecture in mind
Target: Reference implementation 📃
The "official" Client & Server implementations
With in-line detachment getting implemented as part of #3, it should be noted that there are cases when detaching from a running session is not safe to the client's terminal (due to us having no terminal emulation and no replay of display buffers...). Most notable of these is the Mouse events:
vim
(with a mouse-capableTERM
set) behindmonomux
vim
Due to this, it is generally not recommended to detach without backgrounding a "full-fledged" terminal application (like
vim
ormc
) first. Pre-#3, having to explicitly execute another binary sort of forced this behaviour from users. But nothing stops one client from attaching to an existing session where a feature application was running, in which case the new session did NOT receive the terminal state properly (and thus, e.g., mouse events were only happening from one session).The server should be made capable of intercepting the output stream and understanding some control sequences mostly related to changing modes in the underlying terminal. With this, we could approximate what state the session is in, and be able to mark it as "unsafe". If the session is currently "unsafe", we should not let the user detach, and also show a warning when trying to attach.
The text was updated successfully, but these errors were encountered: