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

Control + / (Slash) unconditional triggers the system alert sound on macOS #3014

Open
nkgm opened this issue Nov 24, 2019 · 23 comments
Open

Comments

@nkgm
Copy link

nkgm commented Nov 24, 2019

Reproduced on macOS 10.11

I can map the keyboard shortcut just fine and it works as expected, but it will always (mapped or not) unconditionally trigger the system alert sound. Please note this is not some BELL character created by the shell as this would only cause the Alacritty window to flash.

Also reported Here.

@chrisduerr
Copy link
Member

Alacritty itself doesn't even have the ability to trigger the system alert sound, so this must be triggered by what you're running inside of Alacritty.

Have you tried different terminals/shells?

@nkgm
Copy link
Author

nkgm commented Nov 24, 2019

Have you tried different terminals/shells?

Yep, doesn't happen with iTerm.

Alacritty is using the visual bell (verified by printf "\a") so, unless I'm missing something, it would be impossible for the system alert sound to be triggered by zsh running inside of Alacritty.

Btw my mapping is:

  - { key: Slash, mods: Control, chars: "\x1f" }

which is ^_, also verified by prepending ^V, and also examining the bytes with cat -e and xxd:

# 16 <Control + Slash> keystrokes coming up

$ xxd
^_^_^_^_^_^_^_^_^_^_^_^_^_^_^_^_
00000000: 1f1f 1f1f 1f1f 1f1f 1f1f 1f1f 1f1f 1f1f  ................

#############
# +16 beeps #
#############

Both Control + Slash and Control + Minus produce identical bytes, but for some reason Control + Slash triggers the system alert sound while Control + Minus is completely silent.

/cc @thaedal

@chrisduerr
Copy link
Member

Yep, doesn't happen with iTerm.

Have you tried a different shell too? iTerm uses zsh by default now, so if you're launching bash, that would explain the differences.

Launching Alacritty from iTerm might also help troubleshoot this, just to check the environment matches up.

@bdeak4
Copy link

bdeak4 commented Jan 4, 2020

Any updates? I have same issue.

iTerm + Bash - silent
iTerm + Zsh - silent
Alacritty + Bash - system alert rings
Alacritty + Zsh - system alert rings

@windwp
Copy link

windwp commented Sep 7, 2020

+1
I already disable bell in bash but it stiil make system alert sound

@alexrenda
Copy link

I chased this down to winit, and this hack seems to remove the beep without changing any other functionality: alexrenda/winit@7b1d49e (I'd imagine there's a more principled fix based on https://christiantietze.de/posts/2016/11/nsresponder-finding-beep/ and https://stackoverflow.com/questions/13519647/silence-cocoa-error-beep, but I don't enough experience with Cocoa to know the right way to fix this).

@chrisduerr
Copy link
Member

Is this still an issue with the latest macOS version?

@antonk52
Copy link

antonk52 commented Apr 13, 2021

The issue is still present for alacritty 0.7.2 (5ac8060) and macos 10.15.6

@chrisduerr
Copy link
Member

Have you tried 11?

@antonk52
Copy link

I don't have macos 11 at hand. Sorry

@alexrenda
Copy link

I can confirm that the issue is present (and that the patch above fixes it) on macOS 11

@kirikaza
Copy link

kirikaza commented Jul 9, 2021

BTW, the similar issue is present in standard macOS' Terminal.app too: Ctrl + Slash just beeps without any effect (e.g. no "undo" action in Emacs). And sed -l n doesn't catch it too.

Alternative terminal kitty also beeps but with effect (and sed -n l in kitty sees ^_).

@IzhakJakov
Copy link

Is this still an issue with the latest macOS version?

Yes I am using MacOS Monterey v12.2.1 and Alacritty v0.10.1

@wassimk
Copy link

wassimk commented Jun 4, 2022

I found this issue when looking to remove the beep for control-/ in v0.10.1.

  - { key: Slash,  mods: Control, chars: "\x1f" }

@antonk52
Copy link

antonk52 commented Jun 5, 2022

I found this issue when looking to remove the beep for control-/ in v0.10.1.

  - { key: Slash,  mods: Control, chars: "\x1f" }

Interesting, I still get the beep but the actions that are mapped to ctrl+/ now work also.

I am on alacritty 0.10.1 (2844606) and macOS 12.3.1

@dmackca
Copy link

dmackca commented Jun 7, 2022

Alacritty itself doesn't even have the ability to trigger the system alert sound, so this must be triggered by what you're running inside of Alacritty.

I think it's actually coming from outside of Alacritty. I bound ctrl+/ to a shortcut in my code editor and it works, but I hear the bell sound every time I press it. It doesn't happen in every window (not Chrome, for instance), but it does happen if I focus the empty desktop and press that key combination. Is it the same for you? Is this a shortcut key in the OS? I'd like to change or disable it, if that's the case.

I can't find any trace of it in the keyboard settings or the Mac OS docs... What's it supposed to do?

edit: and to clarify, I assume some apps prevent the key combination from "bubbling" up to the OS, so that's why I hear a bell in some windows but not others.

@IzhakJakov
Copy link

Found this answer by @knoguchi over here:

Ctrl-/ sends 0x1f which is equivalent of Ctrl-_ since the days of VT102. There are many VT100 emulators but they are actually VT102 emulators. iTerm2 works because it's following this behavior.

Only emulators that strictly conform to VT100 specification can't send Ctrl-/. I believe the Terminal app is one of them.

VT100 masks 2 most significant bits of 7 bit ASCII when the control key is pressed. / is 0x2f, o is 0x6f. When the 2 bits are masked they are both 0x0f. VT100 can send Ctrl-o but not Ctrl-/.

@vinioliveira
Copy link

Is anyone else having this issue again? The following code used to work but since I upgraded to 0.11.0 it works only until I hit Slash with no modifiers.

  - { key: Slash,  mods: Control, chars: "\x1f" }

@mike-lloyd03
Copy link

I have recently started having this problem again and the keybind to \x1f no longer works. I upgraded to 0.12.0 and the problem is gone.

@mike-lloyd03
Copy link

mike-lloyd03 commented Apr 4, 2023

Actually no, the problem is still there. Looks like it's intermittent but I'm getting the system error sound when I type Control-/.

@hermesjpappas
Copy link

Bumping this in hopes someone will see it. Trying to bind the same commenting action as on VSCode to terminal-run-(neo)vim but the annoying beep persists, despite the keystroke now working.

@rockyzhang24
Copy link

A feasible workaround to avoid the alert sound when ctrl-/ is pressed:

  1. Create a file ~/Library/KeyBindings/DefaultKeyBinding.dict if it doesn't exist yet
  2. Add the snippet below into DefaultKeyBinding.dict
{
    "^/" = "noop:";
}

It should take effect immediately. If not, reboot your device.
Ref: https://youtrack.jetbrains.com/issue/IDEA-163077/Control-Slash-Ctrl-on-OS-X-macOS-producing-audible-alert

It works on my side with macOS 13.4.1 and alacritty 0.12.2. Hope it is helpful.

@juniorsaldanha
Copy link

To anyone that have issue with Contro-/ on Alacritty and it's trying to configure a keybinding to it on TOML file. Check it out this link: #7608 (comment)

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

No branches or pull requests