Repository navigation
Conversation
- Check $TERMINAL before falling back to the hardcoded term_order list; only honor it when the terminal is in the known terminals array, so the correct invocation syntax is always used. - Fix invocations exposed by honoring $TERMINAL: ptyxis takes "-- PROGRAM" instead of -e, and kitty needs --wait-for-single-instance-window-close so the temp file isn't removed while a single-instance window is still opening it. - Try the ordered candidates until one launches; skip retrying on 126/127 (e.g. the user dismissed pkexec), notify and exit 2 when none work. - Append "exit 0" to the command script: terminals like foot and st propagate the child exit status, which must not be mistaken for a failed launch. - kgx: append the kill command for $TERMINAL=kgx too, guard it against PPID 1, and treat exit 131 (killed after completion) as success. - Remove set -e but abort on mktemp/echo failures and always clean up the temp file.
|
Thanks for working on this! This PR is really valuable for users switching terminals. Could we also apply a similar fix for ["konsole"]="konsole --nofork -e $cmd"Why:
When Alacritty is uninstalled on KDE Plasma installations, this makes CachyOS Hello's Tweaks and Fixes run seamlessly in Konsole. |
- konsole: add --nofork, lxterminal: add --no-remote; both handed the command to a running instance and returned before it was read. - The command reports start/finish, so single-instance terminals are waited for instead of guessed from the terminal's exit status (kgx's --wait is a no-op upstream). - kgx: quit only a process named kgx; killing $PPID hit the user systemd manager and took the session down. - Temp files live in a private dir removed on exit; new exit codes 0-3 with accurate notifications (canceled / not started / did not finish).
|
@VictorBravo9er thanks. It turned out to be wider than konsole.
Tested on foot, konsole, lxterminal, ptyxis, gnome-terminal, alacritty, ghostty and kitty (c34d45f). |
|
Thanks for the thorough update and for digging into I noticed that Appreciate the great work! |
Summary
terminal-helper documented $TERMINAL as the first-priority terminal (see the invariants comment), but never actually read it. The script always fell back to the hardcoded term_order list, so users' preferred terminal was ignored.
Honoring $TERMINAL makes every entry in the terminals map reachable, which exposed several latent issues in those previously untested code paths. This PR fixes them all.
Changes
Notes