[PR #7679] Add support for the BEL control in Windows Terminal #26973

Closed
opened 2026-01-31 09:19:13 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/7679

State: closed
Merged: Yes


Summary of the Pull Request

This PR makes the Windows Terminal play an audible sound when the BEL control character is output.

References

  • There is a separate issue (#1608) to deal with configuring the BEL to trigger visual forms of notification.
  • There was also an issue (#2360) requesting an option to disable the BEL, which should probably be reopened, because this PR does not include any such configuration.

PR Checklist

Detailed Description of the Pull Request / Additional comments

The BEL control was already being forwarded through conpty, so it was just a matter of hooking up the WarningBell dispatch method to actually play a sound. I've used the PlaySound API to output the sound configured for the "Critical Stop" system event (aka SystemHand), since that is the sound used in conhost.

Validation Steps Performed

I've manually confirmed that the terminal produces the expected sound when executing echo ^G in a cmd shell, or printf "\a" in a WSL bash shell.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/7679 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This PR makes the Windows Terminal play an audible sound when the `BEL` control character is output. ## References * There is a separate issue (#1608) to deal with configuring the `BEL` to trigger visual forms of notification. * There was also an issue (#2360) requesting an option to disable the `BEL`, which should probably be reopened, because this PR does not include any such configuration. ## PR Checklist * [x] Closes #4046 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. ## Detailed Description of the Pull Request / Additional comments The `BEL` control was already being forwarded through conpty, so it was just a matter of hooking up the `WarningBell` dispatch method to actually play a sound. I've used the `PlaySound` API to output the sound configured for the "Critical Stop" system event (aka _SystemHand_), since that is the sound used in conhost. ## Validation Steps Performed I've manually confirmed that the terminal produces the expected sound when executing `echo ^G` in a cmd shell, or `printf "\a"` in a WSL bash shell.
claunia added the pull-request label 2026-01-31 09:19:13 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26973