I want to have really complex prompt. It should contains login, computer name, date, time, working directory, result of last command and new line symbol. I want to color each item as well. So I inserted into my .bashrc some kind of monster like this one:# login and computer namePS1='[\e[1;37m\]\u\e[m\]@\e[1;32m\]\h\e[m\]] '# date, time and working directoryPS1=$PS1'[\e[1;34m\]\D{%Y-%m-%d} \e[1;35m\]\t\e[m\]] \e[1;33m\]\w\e[m\] '# result of last command and command prompt in new linePS1=$PS1'\e[1;31m\]${?#0}\e[m\]\n \e[1;36m\]\$\e[m\] 'I do know it is terrible solution, but I have too little experience with bash to improve this. But this is not the only one problem. $ aaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabash: bbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: command not found...After the last a I pressed Home key, but visual caret didn't go to the beginning of the command. As you can see, actual caret went to the beginning. Why this occurred? How can I improve my command prompt in my .bashrc?Update:After using @Groxxda advice, I've got one another problem. My .bashrc PS1 definition looks like this one. Described issue doesn't occur now. But if in my command history I have ls and before this I have cat script.sh, and if I push arrow up twice, I have got command like cat scls and buffer has only two signs (only ls). Why this occurs? How can I manage this?
bash - complex prompt
bash;prompt