I tried following the steps here to configure the prompt: https://nixos.wiki/wiki/Fish
Combined with the information here about the location and content of a basic file: https://fishshell.com/docs/current/faq.html#how-do-i-set-my-prompt
If I understood correctly the content of fish_prompt.fish
should be:
set -l nix_shell_info (
if test -n "$IN_NIX_SHELL"
echo -n "<nix-shell> "
end
)
function fish_prompt
set_color $fish_color_cwd
echo -n (prompt_pwd)
set_color normal
echo -n -s ' $nix_shell_info ~>'
end
After setting it this way the prompt is the same whether in a nix-shell
or not and the variable $nix_shell_info
does not get set.
How can I set it so that it works as intended?