[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: John Cowan
Subject: Re: A one line change I wish to see by default.
Date: Sun, 5 Nov 2023 19:20:24 -0500

On Fri, Oct 27, 2023 at 9:41 AM Zeke Williams <lakeleaf8@gmail.com> wrote:

This is not a flaw of ed, because it doesn't use a means of terminal
control such as ncurses, which is what emacs and vim, and even the vim
> implementation of ex use, it can only just print to stdout and be done
> with it. I was considering using ANSI escape codes to make it possible
> to have the prompt stay at the very bottom and the stdout printed
> always above it, but I feel it might get too messy and ugly and hacky.
> Not to mention, be less portable overall.

It's not that messy.  By outputting the ANSI escape sequence
"\x1B[A\r\x1B[J" before any other output is done, the newline typed at the
end of the command can be effectively undone.  This can be gated behind a
command-line switch to prevent problems with excessively dumb terminals.
It will not work correctly with non-ANSI terminals, but that hardly matters

reply via email to

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