Re: ksh: allow editing empty line with 'v' in vi-mode
Johannes Thyssen Tishman <[email protected]> Fri, 31 Jul 2026 20:23:41 +0000
| Newsgroups | gmane.os.openbsd.tech |
|---|---|
| Message-ID | <[email protected]> |
2026-07-31T20:59:54+0200 Uwe Werler <[email protected]>: > On Fri Jul 31, 2026 at 11:44 AM CEST, Johannes Thyssen Tishman wrote: > > 2026-07-31T09:10:13+0000 Johannes Thyssen Tishman <[email protected]>: > >> 2026-07-30T22:55:18+0200 Uwe Werler <[email protected]>: > >> > and here's another one I once proposed: > >> > > >> > https://marc.info/?l=openbsd-tech&m=166681423915767&w=2 > >> > >> I think it makes sense not to save empty lines in history, so ok jtt@ > >> for the diff in the above archived thread. Given that there were no > >> objections, I can commit if kn@ is still ok with it. > > > > Actually I take this back. Allowing empty commands in history is > > necessary to use ^[v with empty lines. > > Why? I run my ksh with these patches without any problems? Because, IMO, the whole purpose of allowing ^[v on an empty line is to launch the editor with an empty buffer. For this to be possible, an empty line needs to be saved to history such that when fc -e .... is called after pressing ^[v, the last command, i.e., the empty line, is opened in the editor. Otherwise, yes, ^[v on an empty line would still work, but it would launch the editor with the previous command :/