From 840b56cae3c2610b13b74a722ae5db372cac43d2 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Sat, 11 May 2019 20:04:37 -0400 Subject: [PATCH] =?utf8?q?bash:=20fix=20config=20in=20emacs=E2=80=99s=20an?= =?utf8?q?si-term=20and=20GNU=20Screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- .bash_profile | 2 +- .bashrc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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) -- 2.20.1