From 575c00987ed54efedc27c458a36361fefc708026 Mon Sep 17 00:00:00 2001 From: caandt Date: Mon, 2 Sep 2024 14:41:24 -0500 Subject: [PATCH] fix nix-shell initalization in bash --- config/bash/aliases | 1 + config/bash/custom | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/config/bash/aliases b/config/bash/aliases index 973717c..cace717 100644 --- a/config/bash/aliases +++ b/config/bash/aliases @@ -73,3 +73,4 @@ alias path='sed "s/:/\n/g" <<< $PATH' alias utc='date -u +"%Y-%m-%d %H:%M:%S UTC"' alias fonts='fc-list | awk -F: "{ print \$2 }" | sort | uniq | fzf' alias hz='xrandr --output DisplayPort-1 --mode 1920x1080 --rate' +alias ns='nix-shell' diff --git a/config/bash/custom b/config/bash/custom index 5de3c8f..7a484bb 100644 --- a/config/bash/custom +++ b/config/bash/custom @@ -33,7 +33,16 @@ _exists zoxide && eval "$(zoxide init bash)" # use starship prompt, unless in linux terminal if [[ "$TERM" != "linux" ]]; then + # suppress setting title for the commands run by nix-shell initalization + [[ -v IN_NIX_SHELL ]] && _suppress_title=1 function _set_win_title { + if [[ -v _suppress_title ]]; then + # this is the last command run during nix-shell initalization + if [[ "$@" == "shopt -s execfail" ]]; then + unset _suppress_title + fi + return + fi # check if still in .bashrc if declare -F _bashrc_main > /dev/null; then return