Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use ctrl + / in alacritty on Windows #6586

Closed
airtonix opened this issue Dec 25, 2022 · 6 comments
Closed

Cannot use ctrl + / in alacritty on Windows #6586

airtonix opened this issue Dec 25, 2022 · 6 comments

Comments

@airtonix
Copy link

airtonix commented Dec 25, 2022

Pressing Ctrl + / does nothing.

For whatever it's worth: Pressing Ctrl + v pastes whatever is in the clipboard.

So i can't bind C-_ for commenting/uncommenting in neovim.

System

OS: Windows 11
Version: alacritty 0.11.0 (d23330a)
Shell: PowerShell 7.3.1

Logs

Crashes: STDERR, STDOUT
Font/Terminal size: alacritty -vv
Keyboard and bindings: alacritty --print-events

[37.859271800s] [INFO ] [alacritty] glutin event: MainEventsCleared
[37.859429400s] [INFO ] [alacritty] glutin event: RedrawEventsCleared
[37.978542200s] [INFO ] [alacritty] glutin event: NewEvents(WaitCancelled { start: Instant { t: 209698.4448825s }, requested_resume: None })
[37.978888300s] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(WindowId(2099080)), event: KeyboardInput { device_id: DeviceId(DeviceId(0)), input: KeyboardInput { scancode: 53, state: Released, virtual_keycode: Some(Slash), modifiers: CTRL }, is_synthetic: false } }
[37.979271300s] [INFO ] [alacritty] glutin event: MainEventsCleared
[37.979413400s] [INFO ] [alacritty] glutin event: RedrawEventsCleared
[38.234473100s] [INFO ] [alacritty] glutin event: NewEvents(WaitCancelled { start: Instant { t: 209698.5649091s }, requested_resume: None })
[38.234748400s] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(WindowId(2099080)), event: KeyboardInput { device_id: DeviceId(DeviceId(0)), input: KeyboardInput { scancode: 53, state: Pressed, virtual_keycode: Some(Slash), modifiers: CTRL }, is_synthetic: false } }
[38.235074700s] [INFO ] [alacritty] glutin event: MainEventsCleared
[38.235285500s] [INFO ] [alacritty] glutin event: RedrawEventsCleared
[38.347000700s] [INFO ] [alacritty] glutin event: NewEvents(WaitCancelled { start: Instant { t: 209698.8207637s }, requested_resume: None })
[38.347350500s] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(WindowId(2099080)), event: KeyboardInput { device_id: DeviceId(DeviceId(0)), input: KeyboardInput { scancode: 53, state: Released, virtual_keycode: Some(Slash), modifiers: CTRL }, is_synthetic: false } }
[38.347761500s] [INFO ] [alacritty] glutin event: MainEventsCleared
[38.347943900s] [INFO ] [alacritty] glutin event: RedrawEventsCleared
[38.611652900s] [INFO ] [alacritty] glutin event: NewEvents(WaitCancelled { start: Instant { t: 209698.9334393s }, requested_resume: None })
[39.394845700s] [INFO ] [alacritty] glutin event: NewEvents(WaitCancelled { start: Instant { t: 209699.9011342s }, requested_resume: None })
[39.395189000s] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(WindowId(2099080)), event: KeyboardInput { device_id: DeviceId(DeviceId(0)), input: KeyboardInput { scancode: 53, state: Released, virtual_keycode: Some(Slash), modifiers: CTRL }, is_synthetic: false } }
[39.395459400s] [INFO ] [alacritty] glutin event: MainEventsCleared
[39.395608200s] [INFO ] [alacritty] glutin event: RedrawEventsCleared
[39.409893600s] [INFO ] [alacritty] glutin event: NewEvents(WaitCancelled { start: Instant { t: 209699.9810826s }, requested_resume: None })
[39.410080900s] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(WindowId(2099080)), event: ModifiersChanged((empty)) }
[39.410257600s] [INFO ] [alacritty] glutin event: WindowEvent { window_id: WindowId(WindowId(2099080)), event: KeyboardInput { device_id: DeviceId(DeviceId(0)), input: KeyboardInput { scancode: 29, state: Released, virtual_keycode: Some(LControl), modifiers: (empty) }, is_synthetic: false } }
@chrisduerr
Copy link
Member

We get no ReceivedCharacter event after you press Ctrl+/, suggesting that for some reason the character code is swallowed by Windows.

Can you try creating a binding in your config that maps this character manually? I'd expect this to do the trick.

@doongjohn
Copy link

doongjohn commented Feb 14, 2023

try this config

key_bindings:
  # Enable Special Keyboard Combinations in Alacritty / Kitty for Neovim
  # https://youtu.be/lHBD6pdJ-Ng
  # - { key: Semicolon, mods: Control, chars: "\x1b[59;5u" }
  # - { key: Period, mods: Control, chars: "\x1b[46;5u" }
  # - { key: Comma, mods: Control, chars: "\x1b[44;5u" }
  - { key: Slash, mods: Control, chars: "\x1b[47;5u" }
  - { key: Space, mods: Control, chars: "\x1b[32;5u" }
  # - { key: Return, mods: Control, chars: "\x1b[13;5u" }
  # - { key: Return, mods: Shift, chars: "\x1b[13;2u" }

and for neovim use <c-/> for ctrl+/ instead of <c-_>

@chrisduerr
Copy link
Member

Closing since author seems to be gone.

@allworldg
Copy link

or keep use <c-_>. just change a bit :

- { key: Slash, mods: Control, chars: "\x1b[95;5u" }

@qizidog
Copy link

qizidog commented Jul 12, 2023

env:

❱❱❱ alacritty -V
alacritty 0.12.2 (9d9982d)

os info: 
macOS Monterey 12.6.6 (M1)

same issue, fixed with key-bindings as follow:

key_bindings:
  # fix Control-/
  - { key: "Slash", mods: Control, chars: "\x1f" }

@arminveres
Copy link

@qizidog thanks, that fixed it for me as well on macOS 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants