summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bashrc3
1 files changed, 2 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index 91b9d3d5..1a204a14 100644
--- a/.bashrc
+++ b/.bashrc
@@ -11,7 +11,8 @@
# 0: not bold, 91: bright red
# \e[m act like \e[0m, means reset so commands after it will not be colored
# https://en.wikipedia.org/wiki/ANSI_escape_code#3-bit_and_4-bit
-PS1='\e[0;91m[\u@\h \W]\$ \e[0m'
+# need \[ and \] around color codes so bash ignore color codes when calculating line wraps
+PS1='\[\e[0;91m\][\u@\h \W]\$ \[\e[0m\]'
alias ls='ls --color=auto'
alias ll='ls -lah --color=auto'