From: Amin Bandali Date: Sun, 12 May 2019 00:04:37 +0000 (-0400) Subject: bash: fix config in emacs’s ansi-term and GNU Screen X-Git-Url: https://git.shemshak.org/~bandali/configs/commitdiff_plain/840b56cae3c2610b13b74a722ae5db372cac43d2 bash: fix config in emacs’s ansi-term and GNU Screen The issue seems to be that ~/.bash_profile isn’t sourced for interactive non-login shells. So, might want to try detecting non-login shells in general rather than fixing only for ansi-term and screen. --- diff --git a/.bash_profile b/.bash_profile index f41056d..d65bb56 100644 --- a/.bash_profile +++ b/.bash_profile @@ -4,4 +4,4 @@ include () { include ~/.profile include ~/.nix-profile/etc/profile.d/nix.sh -include ~/.bashrc +[[ $TERM = "eterm-color" || $TERM = "screen" ]] || include ~/.bashrc diff --git a/.bashrc b/.bashrc index 7b7d7f8..dded17c 100644 --- a/.bashrc +++ b/.bashrc @@ -1,6 +1,8 @@ # If not running interactively, don't do anything else [[ $- != *i* ]] && return +[[ $TERM = "eterm-color" || $TERM = "screen" ]] && source ~/.bash_profile + # from https://unix.stackexchange.com/a/55935 a_prompt() { cwd=$(sed -e "s:$HOME:~:" -e "s:\(\.\?[^/]\)[^/]*/:\1/:g" <<<$PWD)