[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A one line change I wish to see by default.

From: Antonio Diaz Diaz
Subject: Re: A one line change I wish to see by default.
Date: Fri, 10 Nov 2023 00:28:29 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv: Gecko/20110420 SeaMonkey/2.0.14

Martin Guy wrote:
On 06/11/2023, Antonio Diaz Diaz<antonio@gnu.org>  wrote:
Zeke Williams wrote:
Would there be any additional gotchas (Other than it won't work with
non-ANSI terminals) to using "\x1B[A\r\x1B[J" to work around so to
speak not using ncurses

So I guess the proposed "\x1B[A\r\x1B[J" may work for ed.

Is \r enough to obtain the effect? It would be a bit more... purist,
but I wouldn't encode ANSI escape sequences into ed if it can be avoided.

Sadly \r seems to be the only avoidable part of the sequence above (because the cursor is already at the beginning of the line when the ANSI sequence would be sent to the terminal).

The final part "\x1B[J" (erase up to the end of the page) or "\x1B[K" (erase up to the end of the line) could also be avoided if we limit the sending of the escape sequence to the null command without an address (i.e., a single newline), because in this case the line above the cursor would be already blank.

In any case, even if this feature is implemented, it would be only activated with a command-line option (preferably more informative than '--ex-emulation').

Best regards,

reply via email to

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