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

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

Closed
rivy opened this issue Aug 23, 2023 · 10 comments
Closed

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

rivy opened this issue Aug 23, 2023 · 10 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Cmd.exe The issue is related to the legacy command interpreter, CMD.exe.
Milestone

Comments

@rivy
Copy link

rivy commented 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.

@rivy rivy added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 23, 2023
@zadjii-msft
Copy link
Member

zadjii-msft commented 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.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 23, 2023
@DHowett
Copy link
Member

DHowett commented 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.

@microsoft-github-policy-service microsoft-github-policy-service bot added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 27, 2023
@microsoft-github-policy-service
Copy link
Contributor

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.

@rivy
Copy link
Author

rivy commented 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?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. labels Aug 30, 2023
@lhecker lhecker added Product-Cmd.exe The issue is related to the legacy command interpreter, CMD.exe. Priority-3 A description (P3) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Aug 30, 2023
@lhecker lhecker added this to the Backlog milestone Aug 30, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Tag-Fix Doesn't match tag requirements labels Aug 30, 2023
@DHowett
Copy link
Member

DHowett commented 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 DHowett changed the title 🐛? unable to mute sound effect for failed tab completion (CMD shell) Unable to mute sound effect for failed tab completion in CMD Aug 30, 2023
@zadjii-msft
Copy link
Member

@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.

@j4james
Copy link
Collaborator

j4james commented 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.

@DHowett
Copy link
Member

DHowett commented 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! 😁

zadjii-msft added a commit that referenced this issue Aug 31, 2023
#15870 (comment) is an important note I think deserves to be committed.
@rivy
Copy link
Author

rivy commented 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!

@DHowett
Copy link
Member

DHowett commented 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:

@DHowett DHowett closed this as completed Aug 31, 2023
zadjii-msft added a commit that referenced this issue Sep 5, 2023
#15870 (comment)
is an important note I think deserves to be committed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Priority-3 A description (P3) Product-Cmd.exe The issue is related to the legacy command interpreter, CMD.exe.
Projects
None yet
Development

No branches or pull requests

5 participants