Flashing the window title (and the task bar) via FlashWindowEx has no effect #11975

Closed
opened 2026-01-31 03:02:57 +00:00 by claunia · 6 comments
Owner

Originally created by @UweKeim on GitHub (Jan 6, 2021).

Environment

Windows build number: Microsoft Windows [Version 10.0.19042.685]
Windows Terminal version: 1.4.3243.0

Any other software? Any program that flashes the window title like e.g. my own tool to do so: https://github.com/UweKeim/console-flasher

Steps to reproduce

I'm trying to acchieve that when a program, that runs in a CMD instance inside Windows Terminal, does makes a call to the FlashConsoleEx Windows API call, the flashing of both the window title and the task bar icon of Windows Terminal does happen.

  1. Open a new Terminal instance with a cmd tab (i.e. no PowerShell)
  2. Run a program that flashes the window title (and also the task bar icon)

Expected behavior

The window title and the task bar icon of Windows Terminal flashes.

Actual behavior

The window title and the task bar icon of Windows Terminal does not flash.

Additional remarks

Try running a program that flashes the window title in a regular cmd.exe (i.e. not in Windows Terminal) to see a live example of the expected behaviour.

Originally created by @UweKeim on GitHub (Jan 6, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment Windows build number: Microsoft Windows [Version 10.0.19042.685] Windows Terminal version: 1.4.3243.0 Any other software? Any program that flashes the window title like e.g. my own tool to do so: https://github.com/UweKeim/console-flasher # Steps to reproduce <!-- A description of how to trigger this bug. --> I'm trying to acchieve that when a program, that runs in a CMD instance inside Windows Terminal, does makes a call to the [`FlashConsoleEx` Windows API call](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-flashwindowex), the flashing of both the window title and the task bar icon of Windows Terminal does happen. 1. Open a new Terminal instance with a cmd tab (i.e. _no_ PowerShell) 2. Run a program that flashes the window title (and also the task bar icon) # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> The window title and the task bar icon of Windows Terminal flashes. # Actual behavior <!-- What's actually happening? --> The window title and the task bar icon of Windows Terminal does not flash. # Additional remarks Try running a program that flashes the window title in a regular cmd.exe (i.e. not in Windows Terminal) to see a live example of the expected behaviour.
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 03:02:57 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jan 6, 2021):

Ah, this is another one of those things that won't work in Windows Terminal because conpty is returning garbage for the result of GetConsoleWindow. (Another one of these is #2988). That's one of the APIs that we're trying to discourage users from using in the future, because it won't work cross-platform, and it won't work in remote scenarios (like ssh).

One of the things we are working on is a VT sequence version of this functionality. Have a look at #6700. I'm not sure it does taskbar flashing, per say, but we can set the "progress" state of the window. I'm gonna tag in @PankajBhojwani to see if he has any other thoughts on the matter.

@zadjii-msft commented on GitHub (Jan 6, 2021): Ah, this is another one of those things that won't work in Windows Terminal because conpty is returning garbage for the result of `GetConsoleWindow`. (Another one of these is #2988). That's one of the APIs that we're trying to discourage users from using in the future, because it won't work cross-platform, and it won't work in remote scenarios (like ssh). One of the things we are working on is a VT sequence version of this functionality. Have a look at #6700. I'm not sure it does taskbar _flashing_, per say, but we can set the "progress" state of the window. I'm gonna tag in @PankajBhojwani to see if he has any other thoughts on the matter.
Author
Owner

@PankajBhojwani commented on GitHub (Jan 6, 2021):

What zadjii-msft said! We do already have the infrastructure in place to flash the taskbar (#8215 added the ability to flash the taskbar when BEL is emitted) so adding a VT sequence for this should be straightforward I think

@PankajBhojwani commented on GitHub (Jan 6, 2021): What zadjii-msft said! We do already have the infrastructure in place to flash the taskbar (#8215 added the ability to flash the taskbar when BEL is emitted) so adding a VT sequence for this should be straightforward I think
Author
Owner

@DHowett commented on GitHub (Jan 6, 2021):

We may want to avoid having our own VT sequence for stuff like this. The bell, or the ConEmu Progress API (OSC 9;4) should be sufficient and more expressive. 😄

Whether the window flashes is a user preference, and no application should be able to override that.

@DHowett commented on GitHub (Jan 6, 2021): We may want to avoid having our own VT sequence for stuff like this. The bell, or the ConEmu Progress API (OSC 9;4) should be sufficient and more expressive. :smile: Whether the window flashes is a _user preference_, and no application should be able to override that.
Author
Owner

@DHowett commented on GitHub (Jan 6, 2021):

(Closing as answered, but do feel free to continue the discussion!)

@DHowett commented on GitHub (Jan 6, 2021): (Closing as answered, but do feel free to continue the discussion!)
Author
Owner

@UweKeim commented on GitHub (Jan 7, 2021):

Trying to get my head around the (to me rather new) concept of "VT sequences" (short for "Virtual Terminal Sequences"), here are some resourcen about that topic.


Basic example:

Console.WriteLine("\u001b[31mHello World!\u001b[0m");

This code would set the color of the text to red through the escape sequence ESC[31m. (31 for red), prints "Hello World!" and then finally uses ESC[0m to reset the color.

As another example the following would position the cursor two lines up, by using the escape sequence ESC[2A.

Console.Write("\u001b[2A");

For the Bell VT sequence (^G, as described in https://github.com/microsoft/terminal/pull/8215) I did not get it to work with this:

Console.Write("\u001b[G");

and also not with this:

Console.Write("\a");

But probably the reason it is not yet working is that my version of Windows Terminal does not yet include https://github.com/microsoft/terminal/pull/8215.


I hope this helps others in the future, too.

@UweKeim commented on GitHub (Jan 7, 2021): Trying to get my head around the (to me rather new) concept of "VT sequences" (short for "Virtual Terminal Sequences"), here are some resourcen about that topic. - "[Console Virtual Terminal Sequences](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences)" – Microsoft Docs - "[Using ANSI colour codes in .NET Core Console applications](https://www.jerriepelser.com/blog/using-ansi-color-codes-in-net-console-apps/)" – Random blog post about this topic -------------------- Basic example: ```csharp Console.WriteLine("\u001b[31mHello World!\u001b[0m"); ``` This code would set the color of the text to red through the escape sequence `ESC[31m`. (`31` for red), prints "Hello World!" and then finally uses `ESC[0m` to reset the color. As another example the following would position the cursor two lines up, by using the [escape sequence `ESC[2A`](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#cursor-positioning). ```csharp Console.Write("\u001b[2A"); ``` ----------------- For the Bell VT sequence (`^G`, as described in https://github.com/microsoft/terminal/pull/8215) I did not get it to work with this: ```csharp Console.Write("\u001b[G"); ``` and also not with this: ```csharp Console.Write("\a"); ``` But probably the reason it is not _yet_ working is that my version of Windows Terminal does not yet include https://github.com/microsoft/terminal/pull/8215. ----------------------------------- I hope this helps others in the future, too.
Author
Owner

@UweKeim commented on GitHub (May 22, 2022):

One and a half year later, this still does not work, as #8215 still seems to be not included, not even in the Preview of Windows Terminal. Sad.


Edit 1

It seems it is possible now by using e.g. this from a C# console application:

Console.Write("\a");

See this comment of mine for details.

@UweKeim commented on GitHub (May 22, 2022): One and a half year later, this still does not work, as #8215 still seems to be not included, not even in the Preview of Windows Terminal. Sad. ------------ ### Edit 1 It seems it _is_ possible now by using e.g. this from a C# console application: ```c# Console.Write("\a"); ``` [See this comment of mine for details](https://github.com/microsoft/terminal/pull/8215#issuecomment-1133926842).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11975