Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Chet Ramey
Fran Litterio wrote: >> Also, creating an "option" to decide which behaviour should be followed >> (current one or the one I propose) would make everyone happy > > It should be possible to code a value for PROMPT_COMMAND that sends > the cursor position report escape sequence (for xterm this is >

Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Fran Litterio
Also, creating an "option" to decide which behaviour should be followed (current one or the one I propose) would make everyone happy It should be possible to code a value for PROMPT_COMMAND that sends the cursor position report escape sequence (for xterm this is "\033[6n"), learn the position of

Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Francesco Montorsi
Paul Jarc ha scritto: Francesco Montorsi <[EMAIL PROTECTED]> wrote: why would you ever want to have the prompt printed at non-zero column of the terminal? One possible reason: so you can know whether the previous command ended its output with a newline. Otherwise the output becomes slightly a

Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Paul Jarc
Francesco Montorsi <[EMAIL PROTECTED]> wrote: > why would you ever want to have the prompt printed at non-zero column of > the terminal? One possible reason: so you can know whether the previous command ended its output with a newline. Otherwise the output becomes slightly ambiguous. >> If you

Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Francesco Montorsi
Hi, Bob Proulx ha scritto: PS1='${debian_chroot:+($debian_chroot)}\[\033[01;[EMAIL PROTECTED]:\[\033[01;34m\]\w\[\033[00m\]\$ ' what is it btw? That is a pretty standard Debian setting that looks to see if you are running inside of a chroot. Normally inside of a chroot on Debian systems the

Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Bob Proulx
Francesco Montorsi wrote: > PROMPT_COMMAND='echo -ne "\033]0;${PWD/$HOME/~}\007"' That looks okay to me. It sets the working directory as the xterm window title. > PS1='${debian_chroot:+($debian_chroot)}\[\033[01;[EMAIL > PROTECTED]:\[\033[01;34m\]\w\[\033[00m\]\$ > ' > what is it btw? That i

Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Francesco Montorsi
Hi Bob, thanks for looking into this! Bob Proulx ha scritto: Francesco Montorsi wrote: I think you all have encountered this: do a "cat somefile" where "somefile" is a text file _without_ a final newline. You'll see the prompt is printed both at the end of the text printed by 'cat'

Re: shouldn't prompt printing be smarter?

2007-04-01 Thread Bob Proulx
Francesco Montorsi wrote: >I think you all have encountered this: do a "cat somefile" where > "somefile" is a text file _without_ a final newline. You'll see the > prompt is printed both at the end of the text printed by 'cat' and then, > also at the beginning of that same line. I cannot re

shouldn't prompt printing be smarter?

2007-04-01 Thread Francesco Montorsi
Hi, I think you all have encountered this: do a "cat somefile" where "somefile" is a text file _without_ a final newline. You'll see the prompt is printed both at the end of the text printed by 'cat' and then, also at the beginning of that same line. I'm attaching a screenshot which should

Re: Another bash-3.2 regression: coloured prompt confuses Ctrl+R.

2007-04-01 Thread Andreas Schwab
Chet Ramey <[EMAIL PROTECTED]> writes: > OK, I'm stumped. Try again with PS1='\[\033[01;31m\]12345\[\033[01;34m\] \W \$\[\033[00m\] '. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D5