fix: explicitly allow preservation for TERMINFO in shell-integration

Due to security issues, `sudo` implementations may not preserve
environment variables unless appended with `--preserve-env=list`.

Signed-off-by: definfo <hjsdbb1@gmail.com>
This commit is contained in:
definfo
2025-12-13 16:55:41 +08:00
parent 7a1ff7779b
commit 4a04efaff1
4 changed files with 4 additions and 4 deletions

View File

@@ -103,7 +103,7 @@ if [[ "$GHOSTTY_SHELL_FEATURES" == *"sudo"* && -n "$TERMINFO" ]]; then
if [[ "$sudo_has_sudoedit_flags" == "yes" ]]; then
builtin command sudo "$@";
else
builtin command sudo TERMINFO="$TERMINFO" "$@";
builtin command sudo --preserve-env=TERMINFO "$@";
fi
}
fi