elves / elvish

Powerful scripting language & versatile interactive shell

Home Page:https://elv.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Way to stop history mode and start command mode without clearing line.

aca opened this issue · comments

commented

I wanted to close history navigation and start command(vi) mode to edit command in the history.

Up -> ESC

But it clears the line. So I tried this but it doesn't work properly.

set edit:history:binding["Ctrl-["] =  { edit:command:start }

image

And this doesn't work as edit:close-mode clears the line.

set edit:history:binding["Ctrl-["] =  { edit:close-mode; edit:command:start }

I am searching for some api to preserve current line in history mode.
Or let me know if anyone knows the trick. I'm not sure some new api should be introduced for this.

This is a gap in the API. There should be a new function edit:history:accept for this.