[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shouldn't prompt printing be smarter?
From: |
Chet Ramey |
Subject: |
Re: shouldn't prompt printing be smarter? |
Date: |
Sun, 01 Apr 2007 21:40:45 -0400 |
User-agent: |
Thunderbird 1.5.0.10 (Macintosh/20070221) |
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
> "\033[6n"), learn the position of the cursor, and conditionally output
> a newline if the cursor is not in column 1.
>
> Some quick experimentation shows that this sequence of commands will
> do just that:
This is the right approach. In general, it's not possible for readline
to do this in a terminal-independent way -- termcap and terminfo do not
provide the appropriate capability. If you want to do this, you will
have to decide yourself which terminals to support.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong. No day but today.
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- shouldn't prompt printing be smarter?, Francesco Montorsi, 2007/04/01
- Re: shouldn't prompt printing be smarter?, Bob Proulx, 2007/04/01
- Re: shouldn't prompt printing be smarter?, Francesco Montorsi, 2007/04/01
- Re: shouldn't prompt printing be smarter?, Bob Proulx, 2007/04/01
- Re: shouldn't prompt printing be smarter?, Francesco Montorsi, 2007/04/01
- Re: shouldn't prompt printing be smarter?, Paul Jarc, 2007/04/01
- Re: shouldn't prompt printing be smarter?, Francesco Montorsi, 2007/04/01
- Re: shouldn't prompt printing be smarter?, Fran Litterio, 2007/04/01
- Re: shouldn't prompt printing be smarter?,
Chet Ramey <=
- Message not available
- Re: shouldn't prompt printing be smarter?, Thomas Dickey, 2007/04/02