-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
[Bug]: shell.beep()
doesn't do anything on Linux (unless Electron was launched from a terminal)
#40625
Comments
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
I'm not sure if there is a good solution for this. Here is the code that produces the beep on Linux: electron/shell/common/platform_util_linux.cc Lines 394 to 404 in 433d6c3
The code tries to:
Apart from those methods, the only thing I can think of doing is creating and playing a beep using electron/docs/development/build-instructions-linux.md Lines 21 to 22 in 433d6c3
I'm not sure if doing all of that is worth it just to get a beep though. Meanwhile, Windows and Mac call their respective built-in beep functions :/ electron/shell/common/platform_util_win.cc Lines 448 to 450 in 433d6c3
electron/shell/common/platform_util_mac.mm Lines 241 to 243 in 433d6c3
|
Thanks for that info. I somewhat suspected there was no one neat API for this to address "all of Linux". But the info you linked definitely backs that up. I suppose it would be okay to close this as "not planned" or something like that, since it may not be very doable? Hmm. [EDIT: Speaking as just a random person who uses Electron. I must have contributed some small docs change at some point, I'm labeled as a "Contributor" but I don't really have any status with Electron project different than any other regular end-user.] |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Technically still applies, so "bump". I dunno if Electron folks wanna go the ALSA I'm personally not totally invested in this topic, I filed it after someone asked about it who uses the project I do work on. But, yeah. Still relevant, I guess. |
Preflight Checklist
Electron Version
27.1.2
What operating system are you using?
Ubuntu
Operating System Version
Tested on Ubuntu 22.04 and 23.10, Fedora 39 (all via LiveUSB session)
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
shell.beep()
should always produce a "beep" or "alert" noise.Actual Behavior
On Linux,
shell.beep()
produces no sound or alert, if Electron was launched any way other than from a terminal.Testcase Gist URL
https://gist.github.com/DeeDeeG/d28093106b3f5a747cf925d00ae67357
Additional Information
On Linux, If Electron is launched from a terminal, the terminal app handles the beep, and an audible beep does play, assuming the user's terminal preferences allow it -- see "alert" or "bell" settings in your terminal app of choice.
On Windows and macOS,
shell.beep()
plays an audible noise regardless of whether Electron was launched from a terminal or otherwise.The text was updated successfully, but these errors were encountered: