You are not logged in.
Pages: 1
I recently killed a couple of hours (stone cold) fixing my prompt just the way I wanted it. But tore my hair I did, as the reverse-i-search (Ctrl-R) results turned transparent when selecting them (left/right arrow).
Here's my beautiful PS1 as of tonight, notice the dark background until end of line:
ccup=$'\033[1A'
chome=$'\033[0;0H'
ceod=$'\033[0J'
cend=$'\033[1;1f'
cbold=$'\033[1m'
cunder=$'\033[4m'
cblink=$'\033[5m'
creverse=$'\033[7m'
cconcealed=$'\033[8m'
cblack=$'\033[30m'
cblackb=$'\033[40m'
cwhite=$'\033[37m'
cwhiteb=$'\033[47m'
cnull=$'\033[0m'
#PS1='\n ${cblackb}${cwhite}${cbold}\u${cnull}${cblackb} ${cwhite}\h \j ${cbold}\w${ceod}${cnull}\n ${ceod}\$ '
PS1='\n \[\033[40m\]\[\033[37m\]\[\033[1m\]\u\[\033[0m\]\[\033[40m\] \[\033[37m\]\h \j \[\033[1m\]\w\[\033[0J\]\[\033[0m\]\n \[\033[0J\]\$ '
...and here's the working, but non-favorable, version:
#PS1='\n ${cblackb}${cwhite}${cbold}\u${cnull}${cblackb} ${cwhite}\h \j ${cbold}\w${cnull}\n \$ '
PS1='\n \[\033[40m\]\[\033[37m\]\[\033[1m\]\u\[\033[0m\]\[\033[40m\] \[\033[37m\]\h \j \[\033[1m\]\w\[\033[0m\]\n \$ '
Seems that \[\033[0J\] (end of document) screws things up...
I admit not knowing exactly what I'm doing with the escape sequences, but the reverse-i-search result shouldn't be transparent, right? Setting a background image in the terminal shows no sign of text either. Someone with the force within, please help!
Edit:
Removed some unused color variables to shorten list.
Last edited by Pingwinski (2011-07-31 01:43:06)
Offline
Firstly I never tried this or anything similar so I might be horribly wrong... But the first thing I see is that in the 'wrong' version you have a linebreak '\n' in the middle of the statement and the second thing is that you have '0J' as thirdlast and last value which is the only time you have a value with a capital and the only time it is not a value followed by an 'm'. Possibly either of these is related to the problem. If not then I'll leave it to the experts
Offline
I think you forgot
\[\e[m\]
(which means 'end color') at the end:
PS1='\n \[\033[40m\]\[\033[37m\]\[\033[1m\]\u\[\033[0m\]\[\033[40m\] \[\033[37m\]\h \j \[\033[1m\]\w\[\033[0m\]\n \$ \[\e[m\]'
Now the black background extend only as far as the prompt. The newline '\n' is fine.
Offline
After some research I now have found my first seemingly undocumented bug (hooray..?). See last paragraph.
@FarmerF: the escape sequences are correctly typed, exactly why they look like they do are a mystery for me to
@karol: I actually want the background to extend all the way to the end, but still be able to see the search results Anyway... I tried adding another "null" statement to my desired prompt as suggested, but to no avail. I'm actually nulling the background just after the first "end-of-document" sequence (\[\033[0J\]\) and before the last new-line (using \[\033[0m\] instead of suggested \[\e[m\]). While testing this I found out that...
In Bash, when:
1. setting a background color,
2. using the end-of-document escape sequence,
3. nulling it,
4. then again using the "eod" to continue the nulled formatting
-> reverse-i-search breaks. Results containing an space turns transparent when trying to edit them while other results shows as expected.
Thanks for your replies!
Last edited by Pingwinski (2011-07-31 01:40:24)
Offline
Pages: 1