summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxyz <gky44px1999@gmail.com>2021-05-11 20:09:45 -0700
committerxyz <gky44px1999@gmail.com>2021-05-11 20:09:45 -0700
commit3b336a3b653de8a8eeb707b3977f38600a0fce0f (patch)
treee142269ca3db1b8e1c726376653df68f42915e9f
parent68b29088b293b878ab5d47676c70b231991bac0d (diff)
fix PS1 for better line wrap
-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'