feat: add GHOSTTY_BIN_DIR to path via shell integration (#8976)

Closes #8956

Elvish written by Copilot, the rest was written by me with AI
documentation.
This commit is contained in:
Mitchell Hashimoto
2025-10-01 07:52:12 -07:00
parent ee82baadde
commit 3184187f2d
6 changed files with 34 additions and 4 deletions

View File

@@ -73,6 +73,13 @@ if [ -n "$GHOSTTY_BASH_INJECT" ]; then
builtin unset GHOSTTY_BASH_RCFILE
fi
# Add Ghostty binary to PATH if the path feature is enabled
if [[ "$GHOSTTY_SHELL_FEATURES" == *"path"* && -n "$GHOSTTY_BIN_DIR" ]]; then
if [[ ":$PATH:" != *":$GHOSTTY_BIN_DIR:"* ]]; then
export PATH="$PATH:$GHOSTTY_BIN_DIR"
fi
fi
# Sudo
if [[ "$GHOSTTY_SHELL_FEATURES" == *"sudo"* && -n "$TERMINFO" ]]; then
# Wrap `sudo` command to ensure Ghostty terminfo is preserved.