[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: Zeke Williams
Subject: Re: A one line change I wish to see by default.
Date: Mon, 6 Nov 2023 09:22:44 -0500

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, which is what vim's version of ex uses to
keep the prompt always at the bottom of the screen with any text from
the file above it? If not, I say this can work out nicely.

On Sun, Nov 5, 2023 at 7:20 PM John Cowan <cowan@ccil.org> wrote:
> 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 nowadays.

reply via email to

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