wez / wezterm

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

Neovim not working as expected #6425

Open lemurianredmage opened 23 hours ago

lemurianredmage commented 23 hours ago

What Operating System(s) are you seeing this problem on?

macOS

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20240203-110809-5046fc22

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Current behavior When i open neovim in wezterm, the Insert key is not working, not switching between modes. Also, if i press any other character, it automatically switches to insert mode and i can start typing.

Correct behavior I have iterm and when i open neovim on it, if i press the insert key, then it switches between modes, and if i am in normal mode and i type any other character, i cannot start typing unless i am on insert mode from the Insert key.

To Reproduce

For Insert key issue

For any other character issue

Configuration

no config

Expected Behavior

For Insert key issue

For any other character issue

Logs

Logs for insert key

09:33:43.405  INFO   wezterm_gui::termwindow::keyevent     > key_event RawKeyEvent { key: Char('\u{f746}'), modifiers: NONE, leds: (empty), phys_code: Some(Help), raw_code: 114, repeat_count: 1, key_is_down: true, handled: Handled(false) }
09:33:43.407  INFO   wezterm_gui::termwindow::keyevent     > key_event KeyEvent { key: Char('\u{f746}'), modifiers: NONE, leds: (empty), repeat_count: 1, key_is_down: true, raw: Some(RawKeyEvent { key: Char('\u{f746}'), modifiers: NONE, leds: (empty), phys_code: Some(Help), raw_code: 114, repeat_count: 1, key_is_down: true, handled: Handled(false) }) }
09:33:43.407  INFO   wezterm_gui::termwindow::keyevent     > send to pane DOWN key=Char('\u{f746}') mods=NONE
09:33:43.407  INFO   wezterm_term::terminalstate::keyboard > key_down: sending "\u{f746}", Char('\u{f746}') NONE
09:33:43.502  INFO   wezterm_gui::termwindow::keyevent     > key_event RawKeyEvent { key: Char('\u{f746}'), modifiers: NONE, leds: (empty), phys_code: Some(Help), raw_code: 114, repeat_count: 1, key_is_down: false, handled: Handled(false) }
09:33:43.503  INFO   wezterm_gui::termwindow::keyevent     > key_event KeyEvent { key: Char('\u{f746}'), modifiers: NONE, leds: (empty), repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Char('\u{f746}'), modifiers: NONE, leds: (empty), phys_code: Some(Help), raw_code: 114, repeat_count: 1, key_is_down: false, handled: Handled(false) }) }
09:33:43.503  INFO   wezterm_gui::termwindow::keyevent     > send to pane UP key=Char('\u{f746}') mods=NONE

Logs for 'a' key

09:34:30.366  INFO   wezterm_gui::termwindow::keyevent     > key_event RawKeyEvent { key: Char('a'), modifiers: NONE, leds: (empty), phys_code: Some(A), raw_code: 0, repeat_count: 1, key_is_down: true, handled: Handled(false) }
09:34:30.367  INFO   wezterm_gui::termwindow               > DeadKeyStatus now: None
09:34:30.367  INFO   wezterm_gui::termwindow::keyevent     > key_event KeyEvent { key: Char('a'), modifiers: NONE, leds: (empty), repeat_count: 1, key_is_down: true, raw: None }
09:34:30.367  INFO   wezterm_gui::termwindow::keyevent     > send to pane DOWN key=Char('a') mods=NONE
09:34:30.367  INFO   wezterm_term::terminalstate::keyboard > key_down: sending "a", Char('a') NONE
09:34:30.367  INFO   wezterm_gui::termwindow               > DeadKeyStatus now: None
09:34:30.543  INFO   wezterm_gui::termwindow::keyevent     > key_event RawKeyEvent { key: Char('a'), modifiers: NONE, leds: (empty), phys_code: Some(A), raw_code: 0, repeat_count: 1, key_is_down: false, handled: Handled(false) }
09:34:30.543  INFO   wezterm_gui::termwindow::keyevent     > key_event KeyEvent { key: Char('a'), modifiers: NONE, leds: (empty), repeat_count: 1, key_is_down: false, raw: Some(RawKeyEvent { key: Char('a'), modifiers: NONE, leds: (empty), phys_code: Some(A), raw_code: 0, repeat_count: 1, key_is_down: false, handled: Handled(false) }) }
09:34:30.543  INFO   wezterm_gui::termwindow::keyevent     > send to pane UP key=Char('a') mods=NONE

Anything else?

No response

bew commented 10 hours ago

Maybe it because the insert key isn't bound by default in neovim to enter insert mode (but the a key (like the i key) is).

Have you tried another terminal before saying it's an issue with wezterm?

lemurianredmage commented 10 hours ago

Maybe it because the insert key isn't bound by default in neovim to enter insert mode (but the a key (like the i key) is).

Have you tried another terminal before saying it's an issue with wezterm?

yes i have, in the describe bug section it says that in iTerm is working as expected

bew commented 8 hours ago

Oh yes sorry I didn't see it.

I just tested on a Linux system and it indeed works as you'd expect, and neovim detects the key as <Insert>.

Can you try in neovim (in command or insert mode) with Ctrl-v (not cmd-v) followed by the insert key? Neovim should print you what it understood of the key, does it also give you <Insert> ? If it does, you could check if your distribution has a disabling mapping for it using :nmap <Insert>