fix nix-shell initalization in bash

This commit is contained in:
caandt 2024-09-02 14:41:24 -05:00
parent 8b4ce67189
commit 575c00987e
2 changed files with 10 additions and 0 deletions

View file

@ -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'

View file

@ -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