summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2019-05-11 20:04:37 -0400
committerAmin Bandali <bandali@gnu.org>2019-05-11 20:04:37 -0400
commit840b56cae3c2610b13b74a722ae5db372cac43d2 (patch)
tree2d67f2fc91ef5e0a6dadd7265d34b4ba6f5161d5
parent429f76621cbc558b2b620c8df1b85f6736b38cb2 (diff)
downloadconfigs-840b56cae3c2610b13b74a722ae5db372cac43d2.tar.gz
configs-840b56cae3c2610b13b74a722ae5db372cac43d2.tar.xz
configs-840b56cae3c2610b13b74a722ae5db372cac43d2.zip
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.
-rw-r--r--.bash_profile2
-rw-r--r--.bashrc2
2 files changed, 3 insertions, 1 deletions
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)