starship: move init at the end of .bashrc (#8662)

Move Starship's Bash init at the end of .bashrc using mkOrder 1900.

Starship uses $PROMPT_COMMAND to generate timing information. To do so, it copies the original content of $PROMPT_COMMAND into $STARSHIP_PROMPT_COMMAND. Therefore it should be loaded last to prevent other program to append to $PROMPT_COMMAND.

Only Zoxide, which is initialized with mkOrder 2000, should be loaded after, see: ajeetdsouza/zoxide#1136
This commit is contained in:
Loïc Reynier 2026-01-28 23:06:41 +01:00 committed by GitHub
parent 02d763228d
commit bd9f031efc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,11 +104,13 @@ in
};
};
programs.bash.initExtra = mkIf cfg.enableBashIntegration ''
if [[ $TERM != "dumb" ]]; then
eval "$(${lib.getExe cfg.package} init bash --print-full-init)"
fi
'';
programs.bash.initExtra = mkIf cfg.enableBashIntegration (
lib.mkOrder 1900 ''
if [[ $TERM != "dumb" ]]; then
eval "$(${lib.getExe cfg.package} init bash --print-full-init)"
fi
''
);
programs.zsh.initContent = mkIf cfg.enableZshIntegration ''
if [[ $TERM != "dumb" ]]; then