Unable to mute sound effect for failed tab completion in CMD #20401

Closed
opened 2026-01-31 07:12:41 +00:00 by claunia · 10 comments
Owner

Originally created by @rivy on GitHub (Aug 23, 2023).

Windows Terminal version

1.17.11461.0

Windows build number

10.0.19045.3324

Other Software

No response

Steps to reproduce

1 - Create a tab for a CMD shell.
2 - type cd NonExistent<TAB>, triggers the "asterisk" sound, unaffected by the pertinent settings in the Volume Mixer.

In the volume mixer, the sound is shown as a "System Sound", not as part of the WindowsTerminal.

This is unaffected by any/all "Bell notification" setting(s).

Same behavior is seen in the most recent preview version of WindowsTerminal.

Expected Behavior

I expected "Bell notification" settings to be honored for the sound.

Actual Behavior

"Asterisk" system sound is triggered.

Originally created by @rivy on GitHub (Aug 23, 2023). ### Windows Terminal version 1.17.11461.0 ### Windows build number 10.0.19045.3324 ### Other Software _No response_ ### Steps to reproduce 1 - Create a tab for a CMD shell. 2 - type `cd NonExistent<TAB>`, triggers the "asterisk" sound, unaffected by the pertinent settings in the Volume Mixer. In the volume mixer, the sound is shown as a "System Sound", not as part of the WindowsTerminal. This is unaffected by any/all "Bell notification" setting(s). Same behavior is seen in the most recent preview version of WindowsTerminal. ### Expected Behavior I expected "Bell notification" settings to be honored for the sound. ### Actual Behavior "Asterisk" system sound is triggered.
claunia added the Issue-BugPriority-3Needs-Tag-FixProduct-Cmd.exe labels 2026-01-31 07:12:41 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Aug 23, 2023):

What's your bellStyle and bellSound set to/? IIRC the default bellStyle is "audible", and that defaults to the system notification sound if no other sound was set manually.

@zadjii-msft commented on GitHub (Aug 23, 2023): What's your `bellStyle` and `bellSound` set to/? IIRC the default `bellStyle` is "audible", and that defaults to the system notification sound if no other sound was set manually.
Author
Owner

@DHowett commented on GitHub (Aug 23, 2023):

In addition, there are some shells that call the operating system functions PlaySound or Beep directly. We do not have an opportunity to stop them from doing so, because they are circumventing the terminal entirely.

@DHowett commented on GitHub (Aug 23, 2023): In addition, there are some shells that call the operating system functions `PlaySound` or `Beep` _directly_. We do not have an opportunity to stop them from doing so, because they are circumventing the terminal entirely.
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Aug 27, 2023):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service[bot] commented on GitHub (Aug 27, 2023): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@rivy commented on GitHub (Aug 30, 2023):

@zadjii-msft @DHowett , thanks for the replies.

@zadjii-msft , it's the same for any combination of settings.

I guess the CMD is a shell that directly calls the PlaySound or Beep and, so, can't be blocked/modified?

@rivy commented on GitHub (Aug 30, 2023): @zadjii-msft @DHowett , thanks for the replies. @zadjii-msft , it's the same for any combination of settings. I guess the CMD is a shell that directly calls the `PlaySound` or `Beep` and, so, can't be blocked/modified?
Author
Owner

@DHowett commented on GitHub (Aug 30, 2023):

Unfortunately, it looks like it is! It calls MessageBeep (I had apparently gotten the name wrong).

We're going to triage this as an issue in CMD; however, know that we are pretty hesitant to make changes there since CMD is "critical infrastructure".

@DHowett commented on GitHub (Aug 30, 2023): Unfortunately, it looks like it is! It calls `MessageBeep` (I had apparently gotten the name wrong). We're going to triage this as an issue in CMD; however, know that we are pretty hesitant to make changes there since CMD is "critical infrastructure".
Author
Owner

@zadjii-msft commented on GitHub (Aug 31, 2023):

@DHowett I'm tempted to just close this out - you know our policy on CMD.exe changes. Literally NEVER not burned by it.

We also don't have a "Man if one day we could make cmd.exe changes" megathread (at least, not a public one I could find). I can make one and link this to it, but I don't want people to think this is something we can fix anytime soon.

@zadjii-msft commented on GitHub (Aug 31, 2023): @DHowett I'm tempted to just close this out - you know our policy on CMD.exe changes. Literally NEVER not burned by it. We also don't have a "Man if one day we could make cmd.exe changes" megathread (at least, not a public one I could find). I can make one and link this to it, but I don't want people to think this is something we can fix anytime soon.
Author
Owner

@j4james commented on GitHub (Aug 31, 2023):

My first thought was that this wouldn't be a risky change, but then I remembered https://xkcd.com/1172/. There's bound to be someone somewhere that has patched the user32 dll to hook the MessageBeep call so they can trigger some critical process when the cmd shell beeps. They won't be happy when that breaks.

@j4james commented on GitHub (Aug 31, 2023): My first thought was that this wouldn't be a risky change, but then I remembered https://xkcd.com/1172/. There's bound to be someone somewhere that has patched the user32 dll to hook the `MessageBeep` call so they can trigger some critical process when the cmd shell beeps. They won't be happy when that breaks.
Author
Owner

@DHowett commented on GitHub (Aug 31, 2023):

It also changes the visible (on CONOUT$) output of cmd (boo). You reminded me of [@]vefatica, who was setting user-wide environment variables by injecting into explorer and manipulating its environment rather than using the Environment registry key. . . so, yeah! 😁

@DHowett commented on GitHub (Aug 31, 2023): It also changes the visible (on `CONOUT$`) output of cmd (boo). You reminded me of [@]vefatica, who was setting user-wide environment variables by injecting into explorer and manipulating its environment rather than using the Environment registry key. . . so, yeah! :grin:
Author
Owner

@rivy commented on GitHub (Aug 31, 2023):

@zadjii-msft , @DHowett , @j4james , Thanks for your look at the issue and the entertaining conversation. 😄

I understand that this might be an overly risky change, especially since I can work around it by using the mute button or clink.

I have no issue if you want to close it. Maybe add a note somewhere about limitations of the bell settings.

Thanks!

EDIT: It looks like @zadjii-msft already added a note to the FAQ. Speedy!

@rivy commented on GitHub (Aug 31, 2023): @zadjii-msft , @DHowett , @j4james , Thanks for your look at the issue and the entertaining conversation. 😄 I understand that this might be an overly risky change, especially since I can work around it by using the mute button or `clink`. I have no issue if you want to close it. Maybe add a note somewhere about limitations of the bell settings. Thanks! EDIT: It looks like @zadjii-msft already added a note to the FAQ. Speedy!
Author
Owner

@DHowett commented on GitHub (Aug 31, 2023):

Thanks for the discussion, and for being OK with us closing it. I'd love to fix it, but honestly I've been burned by CMD changes too many times. 😆

@DHowett commented on GitHub (Aug 31, 2023): Thanks for the discussion, and for being OK with us closing it. I'd love to fix it, but honestly I've been burned by CMD changes too many times. :laugh:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20401