feat: add GHOSTTY_BIN_DIR to path via shell integration

This commit is contained in:
Matthew Hrehirchuk
2025-09-30 11:23:02 -06:00
parent ceac472af0
commit 4cc663fc60
6 changed files with 47 additions and 4 deletions

View File

@@ -73,6 +73,14 @@ 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
# Check if the directory is already in PATH
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.