Wezterm: In a vim session, pressing 'Ctrl + [' key combination does not work as expected (i.e. does not exit insert mode)

Created on 11 Jun 2020  路  9Comments  路  Source: wez/wezterm

Bug description

Inside vim, the Ctrl + [ sequence is used to exit insert mode, which doesn't work on the current version of wezterm.

Why bother?

This is a much better default choice for exiting insert mode (compared to Esc which is located far-away from the home row), or remapping caps to Esc etc (i.e. not applicable on other user's machines etc., not portable since OS-specific remapping software needed etc.). Also, while Ctrl + c is a valid choice, it sometimes breaks the flow of using certain plugins etc. In short, at least personally, I find Ctrl + [ to be my preferred option for exiting insert mode, and since this is built into default vim, this is anyway considered to be a bug if the terminal doesn't support a standard functionality like this.

Environment

  • OS: macOS
  • Version: wezterm 20200608-110940-3fb3a61
  • Vim: 8.2.0539

To Reproduce

  1. Fire up vim without any plugins or startup file like so: vim -u NONE
  2. In insert mode, enter some text eg: Mary had a little lamb
  3. Now, press Ctrl + [ to try and exit vim
  4. vim stays in insert mode and the character [ is literally entered into the buffer

Configuration

Problem occurs with default install of wezterm. No specific configuration file was created.

Expected behavior

vim should exit insert mode and come back to normal mode when Ctrl + [ is pressed.

Additional context

The same issue occurs in neovim (v0.4.3) as well.

bug

Most helpful comment

@wez Thanks Wez! This may finally bring my quest for a terminal emulator to an end. I have raised a PR to add this project to the list of cool rust applications at the awesome-rust github repo.

I am finally looking to having the same experience on a truly cross-platform terminal emulator. I have a macbook as my work/travel laptop, a linux workstation for heavy-duty computations, and have to use Windows when logged into campus-wide common-room machines. The portable app setup makes it all the more great. A unified terminal experience and a single config file - a dream, if everything just works as expected.

Alacritty came close, but it doesn't support font ligatures.

All 9 comments

Thanks for the fix!

Thanks for reporting this!

This issue affected each of the ctrl key combinations that have ambiguous representations (i, m, [, { and @), effectively dropping their modifiers.

This should now be fixed in master and you'll be able to download a build for macos from https://github.com/wez/wezterm/runs/759932214 once it is finished building, or from the nightly download in about an hour or so.

@wez Thanks Wez! This may finally bring my quest for a terminal emulator to an end. I have raised a PR to add this project to the list of cool rust applications at the awesome-rust github repo.

I am finally looking to having the same experience on a truly cross-platform terminal emulator. I have a macbook as my work/travel laptop, a linux workstation for heavy-duty computations, and have to use Windows when logged into campus-wide common-room machines. The portable app setup makes it all the more great. A unified terminal experience and a single config file - a dream, if everything just works as expected.

Alacritty came close, but it doesn't support font ligatures.

Thanks. I'll probably wait for the updated version to get to homebrew before checking it out.

Hopefully wezterm helps you to realize your dream!
Please don't hesitate to raise issues/questions or give other feedback!

@wez Would it be possible to release this to aur?

I'm warming up to making a new release, but would like to let my most recent couple of commits bake for a bit first. You can run with https://aur.archlinux.org/packages/wezterm-nightly-bin/ in the meantime!

Wasn't aware of wezterm-nightly-bin thought only wezterm-git existed and that requires running full build. It seems to work so I'm good now.

Thanks a lot for the fix. I can confirm that this issue is now resolved.

Was this page helpful?
0 / 5 - 0 ratings