You are not logged in.
Here is my customized prompt (two lines) in ~/.bashrc (colors defined):
PS1="${CYAN}┌─${NC}\u@\h ${LIGHTBLUE}\w${NC}\n${CYAN}└─{${NC}\@${CYAN}}──${LIGHTCYAN}>${NC} "
It looks like this:
┌─ssri@host ~/Projects/cairo-dock
└─{10:26 AM}──>
Now, when I have a long entry (removing multiple packages, ie pacman removal of cairo-dock-bzr & cairo-dock-plugins-bzr), the input entry does not extend to the edge of my konsole window (80x33). Insteads it stops halfway and continues onto the second line. Since this prompt takes up two lines, the second line portion of the prompt is now overrunned and the entry is considerably garbled:
┌─ssri@host ~/Projects/cairo-dock
-plugins-bzr ─> pacman -R cairo-dock-bzr cairo-dock-
I'm wondering how I can extend keyboard entries towards 80 columns(?) and allow extended entries to continue onto a third line (rather than the second).
Thanks
Last edited by ssri (2010-06-26 21:03:27)
Offline
How do you define your colors? You're supposed to put "\[" and "\]" around the escape sequences:
C_RESET='\[\033[00m\]'
C_BOLD='\[\033[01m\]'
C_UNDERLINED='\[\033[04m\]'
...
This way, the shell knows that these sequences are non-printable characters. If you omit the additional braces, the shell thinks that your escape sequences are actually printed -- which results in "too short" lines.
Offline
I didn't have "\]" from before
BEFORE
BLACK='\e[0;30m'
BLUE='\e[0;34m'
GREEN='\e[0;32m'
CYAN='\e[0;36m'
RED='\e[0;31m'
PURPLE='\e[0;35m'
BROWN='\e[0;33m'
LIGHTGRAY='\e[0;37m'
DARKGRAY='\e[1;30m'
LIGHTBLUE='\e[1;34m'
LIGHTGREEN='\e[1;32m'
LIGHTCYAN='\e[1;36m'
LIGHTRED='\e[1;31m'
LIGHTPURPLE='\e[1;35m'
YELLOW='\e[1;33m'
WHITE='\e[1;37m'
NC='\e[0m' # No Color
AFTER
BLACK='\e[0;30m\]'
BLUE='\e[0;34m\]'
GREEN='\e[0;32m\]'
CYAN='\e[0;36m\]'
RED='\e[0;31m\]'
PURPLE='\e[0;35m\]'
BROWN='\e[0;33m\]'
LIGHTGRAY='\e[0;37m\]'
DARKGRAY='\e[1;30m\]'
LIGHTBLUE='\e[1;34m\]'
LIGHTGREEN='\e[1;32m\]'
LIGHTCYAN='\e[1;36m\]'
LIGHTRED='\e[1;31m\]'
LIGHTPURPLE='\e[1;35m\]'
YELLOW='\e[1;33m\]'
WHITE='\e[1;37m\]'
NC='\e[0m\]' # No Color
RESULT = entries are still truncated
Last edited by ssri (2010-06-26 18:18:43)
Offline
I'm pretty sure you need the '\[' before the colors too, as in Vain's example and the wiki an color bash prompts
Offline
From the bash manpage:
\[ begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
\] end a sequence of non-printing characters
Color codes are terminal control sequences.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
I'm pretty sure you need the '\[' before the colors too, as in Vain's example and the wiki an color bash prompts
Yup, that did it, thanks guys!
Offline