I have defined a PS1 prompt multi-line in my server with Ubuntu 11.04.
The problem occurs when I write a long command, the line cuts before the end of terminal and it continues at beginning the same line:
But if I continue writing the line ends at the end of window and it continues in next line, as expected:
And if I press Home
key the cursor goes to the line above the first line.
I connect to server with SSH in a gnome-terminal.
The PS1 line in /etc/bash.bashrc is:
[ $UID -eq "0" ] && PS1="\e[31m┏━\e[42m┅◉ \e[37m\d ⌚ \t \e[31m┅\e[0m\e[31m━━\e[42m┅◈ \e[37m\H \e[0m\n\e[31m┣\e[0m \w (\e[36m\$(ls -1 | wc -l) fichero/s\e[0m) \n\e[31m┗\e[45m┅◉\e[1;37m \u \e[0m\e[31m━► " || PS1="┏━\e[44m┅◉ \e[37m\d ⌚ \t ┅\e[0m━━\e[44m┅◈ \e[37m \e[0m\n┣━━\e[42m┅◉ kernel: \e[37m$(uname -r) ┅\e[0m━━\e[42m┅◈ uptime: \e[37m$(date -d "`cut -f1 -d. /proc/uptime` seconds ago" +"%a %d %b %R") \e[0m\n┣ \w (\e[36m\$(ls -1 | wc -l) fichero/s\e[0m) \n┗\e[46m┅◉\e[1;37m \u \e[0m━► "
Some of the environment variables:
$ env
TERM=xterm
SHELL=/bin/bash
SSH_TTY=/dev/pts/0
LC_ALL=
LC_MESSAGES=POSIX
LC_COLLATE=C
LANG=es_ES.UTF-8
HISTCONTROL=ignoreboth
SHLVL=1
LESS=-Rsw
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
_=/usr/bin/env
Any idea?
Here I fixed it for you :
Here the first one :
And the second one :