The problem was the date: it was
Code:
PS1="$PS1\[\e[0m\]\[\e[48;5;95;38;5;214m\D{%d.%m@%H.%M.%S}\]" # date
and it takes
Code:
PS1="$PS1\[\e[0m\]\[\e[48;5;95;38;5;214m\]\D{%d.%m@%H.%M.%S}" # date
Now it all goes well
Quote:
Originally Posted by Tonus
Is that on tty ? On a terminal emulator ? Which one ?
A bit more context could help to help...
|
It was from a terminal but on a remote via ssh
Quote:
Originally Posted by computersavvy
On the line you have labeled path \w gives the full path to the pwd while \W give just the current pwd. That can certainly give you a long prompt line.
Beyond that you do not tell us what distro you are on nor the $SHELL you are using so there is no way for most of us to even test and see what might be happening. That PS1 line does not work at all well in bash on my system.
A quick google search for "how to change ps1 in linux" will give you several links and you can even change that search for the shell you are using.
|
The path is a bit long indeed but as I use the full width of the screen, it wasn't the source of the problem.
The shell is bash on the remote, just checked with the command
chck.
The pages on ps1 don't give the same level of information: the basic ones give full explanation but not all options and the pages that give a broader choice of configuration don't tell the syntax to use them.
Quote:
Originally Posted by ondoho
^ Yes please.
I see what you're trying to do there, but I think this way of "composing" it makes it more complex instead of simpler.
But that's beside the point.
2 things: - Are you sure you need to reset ('[\e[0m]') every time you choose a new color?
- The '[' and ']' characters enclose sections that do not take up any space (like change of color). Sections that do take up space should not be enclosed int his way. Getting this wrong can misalign the prompt. Are you sure you got that right everywhere?
|
Well, not breaking it up makes it even harder to read than in several lines...
The reset is needed when 'bolding' and 'backgrounding' but for indentation readability, I put it everywhere.
The only space I have is the last character, but thanks for the trick because I didn't know that