Re: bash variable PS1 confuses the terminal somehow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



13 PROMPT_COMMAND='
14         if (($?)); then
15                 warn="^[[31mWARNING^[[m"
16         else
17                 warn=
18         fi
19         date=`date`
20         PS1="\[^[[s\]\[^[[$(($COLUMNS-28))C\]\[^[[0;33m$date\]\[^[[u\]\[^[[0;31m$warn\]\[^[[0;32m[\]\[^[[1;33m\u\]\[^[[0;32m@\]\[^[[1;36m\w\]\[^[[0;32m]\$\]
21 '

  i changed PROMPT_COMMAND to this as you said, it fixes what i mentioned earlier, but produces more problem, like when i type one character and then use BACKSPACE to delete it, the entire promt is gone, and again bring me to the begining of the line, also when i use ^R to search for history command, the prompt is destroyed too...


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux