Files
Steven Allen 32bf61c51e nixos/foot: only modify the prompt when running inside foot
Without this, these integration scripts will mess with the prompt even
when not running a shell inside of foot. This can break:

1. Terminals that don't understand these sequences (e.g., gnome-terminal
and likely other vte based terminals).
2. Anything that tries to parse the prompt (Emacs packages like
bash-completion).

This patch relies on the TERM variable (against upstream's
recommendation [1]) because:

1. Only Fish [2] has built-in support for querying things like
XTVERSION. Querying terminal features manually is non-trivial and
requires writing to STDOUT, which I'd like to avoid.

2. Even in Fish, this XTVERSION may only be queried after the first
prompt has been displayed ([2]), which is too late.

This patch does not explicitly check if the terminal is interactive as
the modified files are only sourced by interactive shells anyway.

[1]: https://codeberg.org/dnkl/foot#programmatically-checking-if-running-in-foot
[2]: https://fishshell.com/docs/current/cmds/status.html#status-terminal

fixes #374613
2026-06-23 13:49:26 -07:00
..