magicant / yash

Yet another shell
http://magicant.github.io/yash/
GNU General Public License v2.0
330 stars 30 forks source link

Accidentally pressing escape will wreck interactive input until next Ctrl+C #53

Closed raiguard closed 3 months ago

raiguard commented 3 months ago

Describe the bug While typing a command, if you press escape on your keyboard, the input state gets garbled.

To Reproduce Steps to reproduce the behavior:

  1. yash --posix
  2. Type anything (i.e. laz as the start of lazygit)
  3. Press escape
  4. Press any other key. Depending on what key is pressed, different things will happen.

Expected behavior Pressing escape will do nothing. Fish works like I would expect.

Environment (please complete the following information):

Additional context The behavior is slightly different when using the default yashrc, but I haven't narrowed down exactly why. You can see my configuration here.

I use keyd to bind my capslock key to escape when pressed and control when held, so I accidentally press escape quite often.

magicant commented 3 months ago

With the posix option, yash starts in the vi mode, where the Escape key is used to switch from the insert mode to the command mode. You need to press i to return to the insert mode (or Ctrl-C to reset everything).

The default yashrc starts the shell in the emacs mode, where there is no notion of mode switching. Adding set -o emacs to your yashrc might make the shell more friendly to you.

raiguard commented 3 months ago

Oh I see, I didn't bother to read up on what the vi mode did! I actually daily drive a modal editor so now that I know what it's doing it's perfectly intuitive.

Sorry for the noise!