rakitzis / rc

rc shell -- independent re-implementation for Unix of the Plan 9 shell (from circa 1992)
Other
250 stars 23 forks source link

readline: vi mode issue #92

Open nnzv opened 8 months ago

nnzv commented 8 months ago

Hi, I'm running into an issue trying to activate Vi mode in the RC shell with readline support. Usually, I set the "mode" to "vi", but for some reason, it's not kicking in this time. Any thoughts on what might be going wrong?

Steps

$ git clone https://github.com/rakitzis/rc.git
$ git rev-parse HEAD
2e95de304d1387b26423137deeb7d2db4ebf8143
$ make EDIT=readline
$ ./rc
; mode=vi
; # vi mode not working
rakitzis commented 8 months ago

Hi Enzo, is this how it worked in the past? I'm looking at the readline documentation and there is a readline inputrc which lets you set "mode=vi", otherwise the method is to use an escape sequence to switch modes.

Can you tell me when the method you used to switch modes last worked?

I'm also looking at the git history for edit-readline.c, and I don't see anything which might help implement the shortcut you point out.

In general I have to point out that the unit tests in rc do not extend over the readline/editline libraries. This might be an interesting enhancement, but for now these libraries are supported ad-hoc.