0

My goal is to make my text blinking in the console. I know how to do that using a timer (Link), but I want to do this using ANSI codes not like Here. I am aware of the fact, that ANSI codes work in console. Because colors, bold and underline work fine. Blinking text should look like that: "Normal \e[5mBlink", but it is not working. I know projects like SadConsole that provide this option, but I do not know how it works. So, could anyone help me with this problem?

PS. Here is the reference that I know about ANSI: Link

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
Kacper G.
  • 662
  • 8
  • 30
  • Possible duplicate of [Blink text in C#](https://stackoverflow.com/questions/737195/blink-text-in-c-sharp) – SᴇM Jun 21 '18 at 11:02
  • See https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences. It seems that the Anniversary Update for Windows 10 provides this functionality out of the box. – ckuri Jun 21 '18 at 11:03
  • @SeM I think my question is not a duplicate, because I want to use ANSI codes, not timers – Kacper G. Jun 21 '18 at 11:03
  • Supposedly https://stackoverflow.com/questions/49145316/why-no-text-colors-after-using-createfileconout-to-redirect-the-console describes how to enable it, although it didn't work on my machine. – ckuri Jun 21 '18 at 11:36
  • They should have reactivated the ansi in newer Windows 10 (see [here](https://stackoverflow.com/q/16755142/613130)). Note that [you must activate them](https://superuser.com/questions/413073/windows-console-with-ansi-colors-handling/1050078#1050078) – xanatos Jun 21 '18 at 11:50

3 Answers3

0

In the msdn "Console Virtual Terminal Sequences" reference that contains the supported ansi sequences there is no blinking effect. Sorry :-)

To be precise, under Text Formatting:

0 Default Returns all attributes to the default state prior to modification

1 Bold/Bright Applies brightness/intensity flag to foreground color

4 Underline Adds underline

24 No underline Removes underline

7 Negative Swaps foreground and background colors

But there is no 5, that is Blink.

xanatos
  • 109,618
  • 12
  • 197
  • 280
0

Under Windows 10, Windows Terminal is able to manage blinking. Note however that the blinking is active only when the WT has the focus. When you change the active window but still keep W.Terminal on disply on the screen, the blinking stops and will only resume when regaining focus.

Regular (legacy) Windows Console, with ANSI activated (registry key Computer\HKEY_CURRENT_USER\Console, value VirtualTerminalLevel[DW] = 1, W10 required) does NOT handle blinking.

ConEmu (another enhanced console program; it can be installed under W7/64 on the contrary of WT, and handles 16b and 24b ANSI colours on the contrary of J.Hood's ANSICON [8b only]) does NOT handle blinking. Since WT is not installable under W7 (at least I've never been able to install it), it seems that you cannot get an ANSI sequence blinking text without W10+ and WT.

I found that using Clink or regular CMD input mechanism has no influence on blinking capabilities.

ANSI sequences tested using Perl and Python. Blinking ANSI sequence under Windows Terminal on W10

-1

Blink does not work with most of the terminal emulators, works in the tty and XTerm.