Screen Corruption when browsing Command History with Custom Prompt

2008-09-09 Thread Ashley Wilson
From: root To: bug-bash@gnu.org,[EMAIL PROTECTED] Subject: Screen Corruption when browsing Command History with Custom Prompt Configuration Information [Automatically generated, do not change]: Machine: i486 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' -

Re: Screen Corruption when browsing Command History with Custom Prompt

2008-09-09 Thread Chet Ramey
Ashley Wilson wrote: Repeat-By: Set a custom prompt using the PS1 variable as follows: PS1="\n\e[0;31m\u: \w\n# \e[m" Then, browse command history using up/down keys. As the documentation states, you need to bracket sequences of non-printing c

Re: Screen Corruption when browsing Command History with Custom Prompt

2008-09-09 Thread Ashley Wilson
The escape sequence for adding colors are an exception - If you add backslashes to those brackets, it won't (and doesn't) work as expected. I tried what you said : Set PS1 = "\n\e\[0;31m\u: \w\n# \e\[m" The resulting prompt did, still, exhibit the corruption explained in my bug repor

Re: Screen Corruption when browsing Command History with Custom Prompt

2008-09-09 Thread Ashley Wilson
No, Wait! That's not the issue!! This works just fine: PS1="\n\[\e[0;32m\]\u: \w\n# \[\e[m\]" So, all I had to do was to add '\[' before and '\]' after the coloring sequence to fix everything! -- Regards, Ashley. On Wed, Sep 10, 2008 at 12:51 AM, Ashley Wilson <[EMAIL PROTECTED]> wr

Re: Screen Corruption when browsing Command History with Custom Prompt

2008-09-09 Thread Matthew Woehlke
Ashley Wilson wrote: No, Wait! That's not the issue!! This works just fine: PS1="\n\[\e[0;32m\]\u: \w\n# \[\e[m\]" So, all I had to do was to add '\[' before and '\]' after the coloring sequence to fix everything! Of course it works; this is exactly what Chet was trying to tell you.

Re: Screen Corruption when browsing Command History with Custom Prompt

2008-09-09 Thread Ashley Wilson
On Wed, Sep 10, 2008 at 3:02 AM, Matthew Woehlke <[EMAIL PROTECTED]> wrote: > Ashley Wilson wrote: >> >> No, Wait! That's not the issue!! This works just fine: >> >> PS1="\n\[\e[0;32m\]\u: \w\n# \[\e[m\]" >> >> So, all I had to do was to add '\[' before and '\]' after the coloring >> sequen

Differentiating false from fatal

2008-09-09 Thread Dan Stromberg
Say you have a shell script, and you need it to be bulletproof. As you write it, you throw in error checking all over the place. But say you have a function that needs to return a boolean result in some way - call the function "bool_foo" for the sake of discussion. Further assume that bool_fo

script vs. terminal vs. same line vs. ^C

2008-09-09 Thread jidanni
Here we see with the same $-, if you put it on the same line, you'll run it despite ^C... $ cat file echo $-; sleep 7; echo BOOM $ bash -i file bhimBC ^C $ echo $-; sleep 7; echo BOOM bhimBC ^C BOOM OK, same $-, and same test -t , so what does one have to do to make bash think it is a script and

Re: Differentiating false from fatal

2008-09-09 Thread Jon Seymour
On Wed, Sep 10, 2008 at 9:32 AM, Dan Stromberg <[EMAIL PROTECTED]>wrote: > > Say you have a shell script, and you need it to be bulletproof. > > As you write it, you throw in error checking all over the place. > > But say you have a function that needs to return a boolean result in some > way - ca