wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.28k stars 781 forks source link

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

Closed krishnakumarg1984 closed 4 years ago

krishnakumarg1984 commented 4 years ago

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

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.

krishnakumarg1984 commented 4 years ago

Thanks for the fix!

wez commented 4 years ago

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.

krishnakumarg1984 commented 4 years ago

@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.

krishnakumarg1984 commented 4 years ago

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

wez commented 4 years ago

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

prabirshrestha commented 4 years ago

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

wez commented 4 years ago

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!

prabirshrestha commented 4 years ago

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.

krishnakumarg1984 commented 4 years ago

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

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.