Support more shells in wrap_term_launch.sh#1470
Conversation
There was a problem hiding this comment.
Pull request overview
Updates assets/wrap_term_launch.sh to try to support additional terminal emulators (e.g., Ghostty) that require an -e flag when executing a command, so “run in terminal” app launches work across more terminals.
Changes:
- Adds terminal-name detection for
ghostty,alacritty,konsole, andxterm, attempting to re-exec them with-e. - Replaces
exec "$@"with string-based command manipulation and a finalexec $COMMAND.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| COMMAND="$@" | ||
|
|
||
| if [ "$1" = "ghostty" ]; then | ||
| exec ghostty -e ${COMMAND#*ghostty } | ||
| fi | ||
|
|
||
| if [ "$1" = "alacritty" ]; then | ||
| exec alacritty -e ${COMMAND#*alacritty } | ||
| fi | ||
|
|
||
| if [ "$1" = "konsole" ]; then | ||
| exec konsole -e ${COMMAND#*konsole } | ||
| fi | ||
|
|
||
| if [ "$1" = "xterm" ]; then | ||
| exec xterm -e ${COMMAND#*xterm } | ||
| fi | ||
|
|
||
|
|
||
| exec $COMMAND |
| COMMAND="$@" | ||
|
|
||
| if [ "$1" = "ghostty" ]; then | ||
| exec ghostty -e ${COMMAND#*ghostty } | ||
| fi | ||
|
|
||
| if [ "$1" = "alacritty" ]; then | ||
| exec alacritty -e ${COMMAND#*alacritty } | ||
| fi | ||
|
|
||
| if [ "$1" = "konsole" ]; then | ||
| exec konsole -e ${COMMAND#*konsole } | ||
| fi | ||
|
|
||
| if [ "$1" = "xterm" ]; then | ||
| exec xterm -e ${COMMAND#*xterm } | ||
| fi | ||
|
|
||
|
|
||
| exec $COMMAND |
|
You can just add the -e flag to the shell.json configuration: Though there is a permissions issue if you aren't using nix, which I've made a PR for in #1476 |
Most people won't if you think about it, because they don't launch their shells from the cli and execute a command their. |
Ghostty and other terminals need the
-eflag.Useful when launching apps like neovim from application menu, or opening anything terminal related from the menu.
First contribution!