[Top][All Lists]

[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 (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.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]