Describe the bug
When Zash terminal is invoked with -e <command> (e.g. via a Terminal=true .desktop file or the x-terminal-emulator -e update-command pattern), it runs the command but keeps the shell open after the command finishes. Standard terminal emulators (xterm, konsole, gnome-terminal, etc.) close automatically in this scenario.
Impact
This breaks applications that rely on the terminal process exiting after the command completes. For example:
- Cachy-Update / arch-update: uses
Terminal=true .desktop files that invoke the terminal with -e <update-script>. The launcher waits for the terminal process to exit before refreshing the update statefile. Since Zash never exits, the update count badge never resets.
- Any other tool that follows the same
-e / -x pattern.
Expected behaviour
When invoked with -e, -x, or --execute, the terminal should default close_after_execute=True, matching the behaviour of xterm, konsole, gnome-terminal, etc. Users who want to keep the shell open can use an explicit --no-close-after-execute (not yet implemented).
Fix (attached PR will follow)
The fix is minimal — two close_after_execute = True assignments:
- Inside the
--execute= argument handler (line ~593)
- Inside the
-e/-x block where remaining args are captured as the command (line ~614)
The internal update flow (_trigger_update_install) calls create_execute_tab(close_after=False) directly, so it is unaffected.
Environment
- Zash version: 0.8.7 (tested)
- Distribution: CachyOS (Arch Linux)
- Desktop: KDE Plasma (Dolphin TerminalLauncher)
Describe the bug
When Zash terminal is invoked with
-e <command>(e.g. via aTerminal=true.desktopfile or thex-terminal-emulator -e update-commandpattern), it runs the command but keeps the shell open after the command finishes. Standard terminal emulators (xterm, konsole, gnome-terminal, etc.) close automatically in this scenario.Impact
This breaks applications that rely on the terminal process exiting after the command completes. For example:
Terminal=true.desktop files that invoke the terminal with-e <update-script>. The launcher waits for the terminal process to exit before refreshing the update statefile. Since Zash never exits, the update count badge never resets.-e/-xpattern.Expected behaviour
When invoked with
-e,-x, or--execute, the terminal should defaultclose_after_execute=True, matching the behaviour of xterm, konsole, gnome-terminal, etc. Users who want to keep the shell open can use an explicit--no-close-after-execute(not yet implemented).Fix (attached PR will follow)
The fix is minimal — two
close_after_execute = Trueassignments:--execute=argument handler (line ~593)-e/-xblock where remaining args are captured as the command (line ~614)The internal update flow (
_trigger_update_install) callscreate_execute_tab(close_after=False)directly, so it is unaffected.Environment