fix: auto-close terminal tab/window when shell exits (#15448)

This commit is contained in:
alonginwind
2026-07-02 16:43:27 +08:00
committed by GitHub
parent dce221be5a
commit a2b79462ab
4 changed files with 48 additions and 3 deletions

View File

@@ -83,6 +83,13 @@ class _TerminalPageState extends State<TerminalPage>
// Register this terminal model with FFI for event routing
_ffi.registerTerminalModel(widget.terminalId, _terminalModel);
// Auto-close connection when shell exits
_terminalModel.onClosed = () {
if (mounted) {
closeConnection(id: widget.id);
}
};
// Web desktop users have full hardware keyboard access, so the on-screen
// terminal extra keys bar is unnecessary and disabled.
_showTerminalExtraKeys = !isWebDesktop &&