From 29358e8be7e93c75cc0248a077db528e8617a507 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 22 Jun 2023 02:14:49 -0600 Subject: [PATCH] starship: Remove INSIDE_EMACS checks when enabling shell integration (#4135) Many of the terminals supported inside emacs work perfectly fine with STARSHIP. The TERM=dumb case already handles the tramp and eterm cases, so as far as I can tell, this is basically just a check for the benefit of OLD versions of term-mode (see emacswiki.org/emacs/AnsiTerm#:~:text=Historically%2C%20'M%2Dx%20ansi%2Dterm,the%20older%20'C%2Dc'%20binding., which indicates that it also now handles colors). --- modules/programs/starship.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index 519c9c022..fffcaf430 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -100,26 +100,26 @@ in { }; programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then + if [[ $TERM != "dumb" ]]; then eval "$(${starshipCmd} init bash --print-full-init)" fi ''; programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - if [[ $TERM != "dumb" && (-z $INSIDE_EMACS || $INSIDE_EMACS == "vterm") ]]; then + if [[ $TERM != "dumb" ]]; then eval "$(${starshipCmd} init zsh)" fi ''; programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' - if test "$TERM" != "dumb" -a \( -z "$INSIDE_EMACS" -o "$INSIDE_EMACS" = "vterm" \) + if test "$TERM" != "dumb" eval (${starshipCmd} init fish) ${lib.optionalString cfg.enableTransience "enable_transience"} end ''; programs.ion.initExtra = mkIf cfg.enableIonIntegration '' - if test $TERM != "dumb" && not exists -s INSIDE_EMACS || test $INSIDE_EMACS = "vterm" + if test $TERM != "dumb" eval $(${starshipCmd} init ion) end '';