-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Add a setting to flash the taskbar when the terminal emits BEL #8215
Conversation
Can you rename the setting of |
The copy format setting also only has two flags (html/rtf) but we use |
What if we inevitably add a third value to that enum? Suddenly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts:
- Should this only flash the taskbar when the window isn't active? From the docs on
FlashWindow
:Typically, a window is flashed to inform the user that the window requires attention but that it does not currently have the keyboard focus.
- Should we let unfocused panes/tabs flash the taskbar?
- I'm pretty against having visual be the default, considering typing in
bash
and having it BEL at you when it fails to autocomplete, which now causes the window to flash too? IDK that just seems annoying, but that's my opinion
src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h
Outdated
Show resolved
Hide resolved
@@ -800,7 +819,7 @@ | |||
}, | |||
"bellStyle": { | |||
"default": "audible", | |||
"description": "Controls what happens when the application emits a BEL character. When set to \"audible\", the Terminal will play a sound. When set to \"none\", nothing will happen.", | |||
"description": "Controls what happens when the application emits a BEL character. When set to \"all\", the Terminal will play a sound and flash the taskbar icon. An array of specific behaviors can also be used. Supported array values include `audible` and `visual`. When set to \"none\", nothing will happen.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For whatever reason, my head is having a hard time parsing this description. I don't know how to do it better, but this feels weird to me. Summoning @cinnamon-msft
The So a few things:
|
Noted the comments, the default is only I think we should still flash the taskbar even if it wasn't the last active control that sent the bell though - its the same with the audible bell currently, we will play the sound even if it wasn't the last active control that sent it. |
This does not seem to work for me (tried setting this and playing BEL in terminal - no flash in taskbar). Can someone else try as well just in case? |
It doesn't flash the taskbar for me, but I didn't think it was meant to. It just flashes whatever part of the screen you've chosen in the settings. It's either the title bar (or in the case of a UWP app, the window border), the whole of the active window, or the whole screen. You can't miss it, even if the app is in the background, because it effects the focused window, not the window that produced the sound. |
OK well as not default, flashing our own HWND/taskbar icon, and selectively depending on how focused it is sounds better to me. |
Also to be clear, this only flashes the taskbar icon, not the window frame? And only when it's not otherwise in focus? Can you show a gif of it working? |
It only flashes the taskbar icon when the terminal is not focused, yes. Gif added! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I'm good with this.
src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h
Show resolved
Hide resolved
…/pabhoj/visual_bell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
Just gotta give it a code format! |
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Needs conflict resolve |
Any plan to make this change ever available, at least in the Preview of Windows Terminal? |
This feature has been available for two years. |
Thanks, @DHowett I've just tried the sequence of the above GIF in a PowerShell: sleep 3;"^G" Then quickly minimized the window and nothing happens. I.e. nothing flashing. I'm using:
Probably I'm just doing something stupid and/or missing some plain obvious things. Trying it from a .NET console application with: Console.Write("\u001b[G"); also does not flash the task bar icon. OK, I think I get it now: The "BellStyle" setting was not set explicitly, thus resulting in only a sound (which was not hearable since I turned of all system sounds). After configuring the CMD type to this: My C# console application was able to make the task bar flash/be lightened when using this: Console.Write("\a"); Resulting in this effect: I'm still unable to do the same for PowerShell and Update:After reading Dustin's reply, this one worked correctly in PowerShell: sleep 3;[char]0x7 |
Glad you got it working! So, couple things. |
The terminal taskbar icon can now flash when the BEL sequence is
emitted, to let the user know something needs their attention.
The
BellStyle
setting can now be set toaudible
,visual
or both ornone. When the pane receives a BEL event and the
bellStyle
includesvisual
, we bubble the event up all the way toAppHost
to handleflashing the taskbar.
Closes #1608