Add support for turning off cursor blink #1834

Open
opened 2026-01-30 22:39:08 +00:00 by claunia · 65 comments
Owner

Originally created by @KiYugadgeter on GitHub (Jun 22, 2019).

I don't link blinking cursor on terminal.
so I have tried to stop blink of cursor from settings but there is no option to do it.
How to disable blink of cursor?

Originally created by @KiYugadgeter on GitHub (Jun 22, 2019). I don't link blinking cursor on terminal. so I have tried to stop blink of cursor from settings but there is no option to do it. How to disable blink of cursor?
Author
Owner

@leptr commented on GitHub (Jun 22, 2019):

I just set the cursor color to match the background color so it would be invisible, I couldn't find any other way to either remove it or stop it from blinking, but I hope this helps you

@leptr commented on GitHub (Jun 22, 2019): I just set the cursor color to match the background color so it would be invisible, I couldn't find any other way to either remove it or stop it from blinking, but I hope this helps you
Author
Owner

@Lo0oG commented on GitHub (Jun 22, 2019):

Go into the Control Panel and search for Blink.

@Lo0oG commented on GitHub (Jun 22, 2019): Go into the Control Panel and search for Blink.
Author
Owner

@AeliusSaionji commented on GitHub (Jun 23, 2019):

Seconding a request for this setting.

@AeliusSaionji commented on GitHub (Jun 23, 2019): Seconding a request for this setting.
Author
Owner

@leptr commented on GitHub (Jun 25, 2019):

also I would love to see an option to make it look like that box cursor that we have in linux terminal, I think that would be a nice feature

@leptr commented on GitHub (Jun 25, 2019): also I would love to see an option to make it look like that box cursor that we have in linux terminal, I think that would be a nice feature
Author
Owner

@DHowett-MSFT commented on GitHub (Jun 25, 2019):

What, you mean this?
image

Set your cursor to filledBox.

@DHowett-MSFT commented on GitHub (Jun 25, 2019): What, you mean this? ![image](https://user-images.githubusercontent.com/14316954/60136920-5e82ec00-975a-11e9-9be1-07db240bccd3.png) Set your cursor to `filledBox`.
Author
Owner

@leptr commented on GitHub (Jun 25, 2019):

What, you mean this?
image

Set your cursor to filledBox.

Hey, thanks! I didn't know the different cursor names

@leptr commented on GitHub (Jun 25, 2019): > What, you mean this? > ![image](https://user-images.githubusercontent.com/14316954/60136920-5e82ec00-975a-11e9-9be1-07db240bccd3.png) > > Set your cursor to `filledBox`. Hey, thanks! I didn't know the different cursor names
Author
Owner

@KiYugadgeter commented on GitHub (Jun 26, 2019):

You could see here.
https://github.com/microsoft/terminal/issues/1294#issuecomment-502539208

@KiYugadgeter commented on GitHub (Jun 26, 2019): You could see here. https://github.com/microsoft/terminal/issues/1294#issuecomment-502539208
Author
Owner

@AeliusSaionji commented on GitHub (Jun 26, 2019):

Or reference the nice documentation here https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md

@AeliusSaionji commented on GitHub (Jun 26, 2019): Or reference the nice documentation here https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md
Author
Owner

@dkter commented on GitHub (Jun 30, 2019):

The cursor blinking can be turned off (system-wide) by going to Keyboard Properties in the Control Panel and turning the cursor blink rate all the way down:

image

Would it be useful to disable the cursor blinking for just the terminal app?

@dkter commented on GitHub (Jun 30, 2019): The cursor blinking can be turned off (system-wide) by going to Keyboard Properties in the Control Panel and turning the cursor blink rate all the way down: ![image](https://user-images.githubusercontent.com/34610081/60402879-67612c80-9b63-11e9-9b5a-00ab549f2327.png) Would it be useful to disable the cursor blinking for just the terminal app?
Author
Owner

@KiYugadgeter commented on GitHub (Jul 2, 2019):

I want to disable it in terminal app only

2019年7月1日(月) 7:19 David Teresi notifications@github.com:

The cursor blinking can be turned off (system-wide) by going to Keyboard
Properties in the Control Panel and turning the cursor blink rate all the
way down:

[image: image]
https://user-images.githubusercontent.com/34610081/60402879-67612c80-9b63-11e9-9b5a-00ab549f2327.png

Would it be useful to disable the cursor blinking for just the terminal
app?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/terminal/issues/1379?email_source=notifications&email_token=AB4HIGH7WYVJYUIZT2IBEPTP5EWQRA5CNFSM4H2V6GEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4U4XY#issuecomment-507072095,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB4HIGDR33VYEXMMWRVPS5LP5EWQRANCNFSM4H2V6GEA
.

@KiYugadgeter commented on GitHub (Jul 2, 2019): I want to disable it in terminal app only 2019年7月1日(月) 7:19 David Teresi <notifications@github.com>: > The cursor blinking can be turned off (system-wide) by going to Keyboard > Properties in the Control Panel and turning the cursor blink rate all the > way down: > > [image: image] > <https://user-images.githubusercontent.com/34610081/60402879-67612c80-9b63-11e9-9b5a-00ab549f2327.png> > > Would it be useful to disable the cursor blinking for just the terminal > app? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/microsoft/terminal/issues/1379?email_source=notifications&email_token=AB4HIGH7WYVJYUIZT2IBEPTP5EWQRA5CNFSM4H2V6GEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY4U4XY#issuecomment-507072095>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AB4HIGDR33VYEXMMWRVPS5LP5EWQRANCNFSM4H2V6GEA> > . >
Author
Owner

@SCWells72 commented on GitHub (Jul 2, 2019):

Agreed that this should be a distinct option just for the terminal app. Here's how it can be configured in mintty:

image

Note the distinct config fields for cursor shape and whether to blink.

@SCWells72 commented on GitHub (Jul 2, 2019): Agreed that this should be a distinct option just for the terminal app. Here's how it can be configured in mintty: ![image](https://user-images.githubusercontent.com/7671043/60527999-0f3c3e80-9cb9-11e9-9ea6-e4c9e67acae8.png) Note the distinct config fields for cursor shape and whether to blink.
Author
Owner

@KiYugadgeter commented on GitHub (Jul 3, 2019):

@DHowett-MSFT I've tried write some code to disable it.
But it looks like there are some error.

  1. IDE has indicated redefinition of method definition of UseBlinkCursor in TerminalSettings.cpp despite I have defined just one time
  2. IKeyBindings, IKeyChord in cascadia\TerminalApp\AppKeyBindings.idl unresolved type declaration.

How to fix it?

https://github.com/KiYugadgeter/terminal/tree/my_build

@KiYugadgeter commented on GitHub (Jul 3, 2019): @DHowett-MSFT I've tried write some code to disable it. But it looks like there are some error. 1. IDE has indicated redefinition of method definition of UseBlinkCursor in TerminalSettings.cpp despite I have defined just one time 2. IKeyBindings, IKeyChord in cascadia\TerminalApp\AppKeyBindings.idl unresolved type declaration. How to fix it? https://github.com/KiYugadgeter/terminal/tree/my_build
Author
Owner

@hwo411 commented on GitHub (Aug 18, 2019):

Any ETA to add this?

@hwo411 commented on GitHub (Aug 18, 2019): Any ETA to add this?
Author
Owner

@zadjii-msft commented on GitHub (Aug 19, 2019):

@hwo411 Nope - It's marked as "Terminal Backlog", which means we don't think we're going to get to it ourselves before we release a 1.0 version of the terminal.

It's also marked "Help-Wanted", so if someone's feeling particularly passionate about this, they should feel free to build a solution themselves, and we'd happily review a PR 😉

@zadjii-msft commented on GitHub (Aug 19, 2019): @hwo411 Nope - It's marked as "Terminal Backlog", which means we don't think we're going to get to it ourselves before we release a 1.0 version of the terminal. It's also marked "Help-Wanted", so if someone's feeling particularly passionate about this, they should feel free to build a solution themselves, and we'd happily review a PR 😉
Author
Owner

@hwo411 commented on GitHub (Sep 5, 2019):

@zadjii-msft thanks for explanation!

@hwo411 commented on GitHub (Sep 5, 2019): @zadjii-msft thanks for explanation!
Author
Owner

@Kagami commented on GitHub (Sep 30, 2019):

@skyline75489 created PR for this feature: https://github.com/microsoft/terminal/pull/2892

@Kagami commented on GitHub (Sep 30, 2019): @skyline75489 created PR for this feature: https://github.com/microsoft/terminal/pull/2892
Author
Owner

@qqkookie commented on GitHub (Nov 14, 2019):

Blinking is only binary on/off option, so how about merging blinking attribute and cursor shape attribute into one attribute, like "filledbox" vs "static-filledbox", or "blinking-filledbox" vs "filledbox"?

The name "solid" for non-blinking cursor is confusing. Normally "solid box" means "filledbox". So "solid-emptybox" may be confusing. I prefer "static" as non-blinking attribute name.

The cursor name "filledbox" is rather strange too. I suggest to use name like "solidbox" or "fullbox" (Unicode name) for current "filledbox" attribute value name.

The cursor name "vintage" is also not intuitive. How about " quarterblock"?

Most people will use just one of "static-solidbox" or "blinking-bar". IMHO, default should be static and solidbox (filledbox). And if wt window lose input focus, cursor should stop blinking and turn into static-emptybox.

EDIT: Hmm, #2892 seems to be more appropriate thread.

@qqkookie commented on GitHub (Nov 14, 2019): Blinking is only binary on/off option, so how about merging blinking attribute and cursor shape attribute into one attribute, like "filledbox" vs "static-filledbox", or "blinking-filledbox" vs "filledbox"? The name "solid" for non-blinking cursor is confusing. Normally "solid box" means "filledbox". So "solid-emptybox" may be confusing. I prefer "static" as non-blinking attribute name. The cursor name "filledbox" is rather strange too. I suggest to use name like "solidbox" or "fullbox" (Unicode name) for current "filledbox" attribute value name. The cursor name "vintage" is also not intuitive. How about " quarterblock"? Most people will use just one of "static-solidbox" or "blinking-bar". IMHO, default should be static and solidbox (filledbox). And if wt window lose input focus, cursor should stop blinking and turn into static-emptybox. EDIT: Hmm, #2892 seems to be more appropriate thread.
Author
Owner

@sirfz commented on GitHub (Feb 14, 2020):

Possibly relevant: is it possible to make the filledBox cursor transparent? Right now (at least in my case) the box is opaque while emptyBox just doesn't have the same feel to what I'm used to (a block which still displays what's under it).

How it looks in Windows Terminal:

image

How it looks in other terminals (in this case alacritty):

image

@sirfz commented on GitHub (Feb 14, 2020): Possibly relevant: is it possible to make the filledBox cursor transparent? Right now (at least in my case) the box is opaque while emptyBox just doesn't have the same feel to what I'm used to (a block which still displays what's under it). How it looks in Windows Terminal: ![image](https://user-images.githubusercontent.com/4741099/74553723-98f6fe80-4f60-11ea-88c6-1caf25b937a3.png) How it looks in other terminals (in this case alacritty): ![image](https://user-images.githubusercontent.com/4741099/74553674-8250a780-4f60-11ea-987e-b52b34861b71.png)
Author
Owner

@Avi0 commented on GitHub (Apr 26, 2020):

Go into the Control Panel and search for Blink.

Disabling cursor blinking system wide causes Windows taskbar icon notifications not blink and not disappear. This broken Windows functionality prevents users from disabling cursor blinking. Since this issue exists for years, nobody is going to fix it in Windows. Hence, unfortunately, cursor blink rates should be controlled by applications.

Lack of this feature in Windows Terminal is the only thing that prevents me from switching to Windows Terminal completely.

@Avi0 commented on GitHub (Apr 26, 2020): > Go into the Control Panel and search for Blink. Disabling cursor blinking system wide causes Windows taskbar icon notifications not blink and not disappear. This broken Windows functionality prevents users from disabling cursor blinking. Since this issue exists for years, nobody is going to fix it in Windows. Hence, unfortunately, cursor blink rates should be controlled by applications. Lack of this feature in Windows Terminal is the only thing that prevents me from switching to Windows Terminal completely.
Author
Owner

@mdtauk commented on GitHub (Jun 5, 2020):

If blinking becomes a cursor type or state, could there be an option for both a binary on and off, as well as an animated fade for the cursor?

@mdtauk commented on GitHub (Jun 5, 2020): If blinking becomes a cursor type or state, could there be an option for both a binary on and off, as well as an animated fade for the cursor?
Author
Owner

@dkter commented on GitHub (Jun 5, 2020):

@mdtauk could you maybe point to an example of a program with an animated fading cursor? I'm not sure what exactly you're proposing.

@dkter commented on GitHub (Jun 5, 2020): @mdtauk could you maybe point to an example of a program with an animated fading cursor? I'm not sure what exactly you're proposing.
Author
Owner

@mdtauk commented on GitHub (Jun 5, 2020):

I can't, but it would look smoother, and I think would work well with the vintage terminal visual effects. It only needs to be a few frames of the cursor fading in and then out again

@mdtauk commented on GitHub (Jun 5, 2020): I can't, but it would look smoother, and I think would work well with the vintage terminal visual effects. It only needs to be a few frames of the cursor fading in and then out again
Author
Owner

@thegreyshadow commented on GitHub (Aug 29, 2020):

I second this request. Please add a way to turn off blinking cursor in terminal without resorting to any system-wide hack. Thanks in advance, I would really like to have this feature added to this great app.

@thegreyshadow commented on GitHub (Aug 29, 2020): I second this request. Please add a way to turn off blinking cursor in terminal without resorting to any system-wide hack. Thanks in advance, I would really like to have this feature added to this great app.
Author
Owner

@Avi0 commented on GitHub (Sep 2, 2020):

without resorting to any system-wide hack.

The problem is that there is no acceptable system-wide hack to resort to. If you disable cursor blink globally, you'll end up with broken taskbar icon notifications. Icons will glow orange permanently.

@Avi0 commented on GitHub (Sep 2, 2020): > without resorting to any system-wide hack. The problem is that there is no acceptable system-wide hack to resort to. If you disable cursor blink globally, you'll end up with broken taskbar icon notifications. Icons will glow orange permanently.
Author
Owner

@DHowett commented on GitHub (Sep 2, 2020):

permanently

"Until you interact with them, clearing their urgency state."

@DHowett commented on GitHub (Sep 2, 2020): > permanently "Until you interact with them, clearing their urgency state."
Author
Owner

@thegreyshadow commented on GitHub (Sep 2, 2020):

without resorting to any system-wide hack.

The problem is that there is no acceptable system-wide hack to resort to. If you disable cursor blink globally, you'll end up with broken taskbar icon notifications. Icons will glow orange permanently.

My point exactly.

@thegreyshadow commented on GitHub (Sep 2, 2020): > > without resorting to any system-wide hack. > > The problem is that there is no acceptable system-wide hack to resort to. If you disable cursor blink globally, you'll end up with broken taskbar icon notifications. Icons will glow orange permanently. My point exactly.
Author
Owner

@Avi0 commented on GitHub (Sep 3, 2020):

permanently

"Until you interact with them, clearing their urgency state."

No! This is the annoyance exactly. The state is not cleared after interaction, they stay orange. I found a workaround, switch to another desktop and back, but this is still an annoyance.

@Avi0 commented on GitHub (Sep 3, 2020): > > permanently > > "Until you interact with them, clearing their urgency state." No! This is the annoyance exactly. The state is not cleared after interaction, they stay orange. I found a workaround, switch to another desktop and back, but this is still an annoyance.
Author
Owner

@igor-vivaldi commented on GitHub (Sep 21, 2020):

The original reason for a blinking cursor was that a thin vertical line was not very noticeable. But this is not applicable to a solid filled box with inverse video. It is very visible. Adding blinking makes it too visible to the point of distraction. For this reason a system settings that assumes a thin line should not apply when the cursor is a filled box.

This suggest that blinking or not should be a part of cursor shape.

@igor-vivaldi commented on GitHub (Sep 21, 2020): The original reason for a blinking cursor was that a thin vertical line was not very noticeable. But this is not applicable to a solid filled box with inverse video. It is very visible. Adding blinking makes it too visible to the point of distraction. For this reason a system settings that assumes a thin line should not apply when the cursor is a filled box. This suggest that blinking or not should be a part of cursor shape.
Author
Owner

@mangelozzi commented on GitHub (Sep 21, 2020):

The original reason for a blinking cursor was that a thin vertical line was not very noticeable. But this is not applicable to a solid filled box with inverse video. It is very visible. Adding blinking makes it too visible to the point of distraction. For this reason a system settings that assumes a thin line should not apply when the cursor is a filled box.

This suggest that blinking or not should be a part of cursor shape.

I agree with you, but not everyone is the same (due to personality differences), someone may want a flashing big box and think its perfect. An independat settings would mean everyone is then happy. Unfortunately WT does not support inverse video yet, so this is not the case (there are times when th==my white cursor is on light text and I can barely see it, and if on white then not at all).

@mangelozzi commented on GitHub (Sep 21, 2020): > The original reason for a blinking cursor was that a thin vertical line was not very noticeable. But this is not applicable to a solid filled box with inverse video. It is very visible. Adding blinking makes it too visible to the point of distraction. For this reason a system settings that assumes a thin line should not apply when the cursor is a filled box. > > This suggest that blinking or not should be a part of cursor shape. I agree with you, but not everyone is the same (due to personality differences), someone may want a flashing big box and think its perfect. An independat settings would mean everyone is then happy. Unfortunately WT does not support inverse video yet, so this is not the case (there are times when th==my white cursor is on light text and I can barely see it, and if on white then not at all).
Author
Owner

@wusticality commented on GitHub (Nov 2, 2020):

What is the status on this? I'd really prefer to not have a blinking cursor within Windows Terminal (and Emacs, which to my knowledge cannot turn off this functionality as it's driven by the shell).

@wusticality commented on GitHub (Nov 2, 2020): What is the status on this? I'd really prefer to not have a blinking cursor within Windows Terminal (and `Emacs`, which to my knowledge cannot turn off this functionality as it's driven by the shell).
Author
Owner

@yan12125 commented on GitHub (Nov 29, 2020):

Printing a DECSCUSR command from bash/zsh stops the cursor from blinking:

echo -e "\e[2 q"

More options can be found at https://github.com/MicrosoftDocs/Console-Docs/issues/140.

I don't know how to achieve it in cmd or powershell, though.

@yan12125 commented on GitHub (Nov 29, 2020): Printing a DECSCUSR command from bash/zsh stops the cursor from blinking: ``` echo -e "\e[2 q" ``` More options can be found at https://github.com/MicrosoftDocs/Console-Docs/issues/140. I don't know how to achieve it in cmd or powershell, though.
Author
Owner

@thenger commented on GitHub (Nov 30, 2020):

in powershell you can do:

"`e[2 q"

or with python:

python -c "print('\033[2 q')"
@thenger commented on GitHub (Nov 30, 2020): in powershell you can do: ```powershell "`e[2 q" ``` or with python: ``` python -c "print('\033[2 q')" ```
Author
Owner

@ndavidpsi commented on GitHub (Dec 1, 2020):

Any updates on how to have a non blinking cursor?

@ndavidpsi commented on GitHub (Dec 1, 2020): Any updates on how to have a non blinking cursor?
Author
Owner

@stanio commented on GitHub (Dec 2, 2020):

Any updates on how to have a non blinking cursor?

Per previous comments, I've created a cmd (steady_cur.cmd) script on my PATH:

@echo <esc>[2 q

Where <esc> is a single ASCII character 0x1B I've entered into the file using a hex-editor. Appears to work with all of Command Prompt, PowerShell and Git Bash. You could change the "commandline" of the Command Prompt profile in the Windows Terminal Settings (settings.json) to:

                "commandline": "cmd.exe /k steady_cur",

to have it automatically applied in new consoles.

@stanio commented on GitHub (Dec 2, 2020): > Any updates on how to have a non blinking cursor? Per previous comments, I've created a `cmd` (`steady_cur.cmd`) script on my `PATH`: ```cmd @echo <esc>[2 q ``` Where `<esc>` is a single ASCII character `0x1B` I've entered into the file using a hex-editor. Appears to work with all of Command Prompt, PowerShell and Git Bash. You could change the `"commandline"` of the Command Prompt profile in the Windows Terminal Settings (`settings.json`) to: ```json "commandline": "cmd.exe /k steady_cur", ``` to have it automatically applied in new consoles.
Author
Owner

@ndavidpsi commented on GitHub (Dec 2, 2020):

how nice, I'll try it

@ndavidpsi commented on GitHub (Dec 2, 2020): how nice, I'll try it
Author
Owner

@ndavidpsi commented on GitHub (Dec 2, 2020):

Alas it did not work, is the syntax correct?

@ndavidpsi commented on GitHub (Dec 2, 2020): Alas it did not work, is the syntax correct?
Author
Owner

@stanio commented on GitHub (Dec 2, 2020):

@echo <esc>[2 q

You need to replace <esc> with the byte 0x1B, and not the literal text 0x1B (not sure what you're actually trying).

@stanio commented on GitHub (Dec 2, 2020): ```cmd @echo <esc>[2 q ``` You need to replace `<esc>` with the byte `0x1B`, and not the literal text `0x1B` (not sure what you're actually trying).
Author
Owner

@ndavidpsi commented on GitHub (Dec 2, 2020):

Update: sorry I didn't read it properly before. It works great now!

@ndavidpsi commented on GitHub (Dec 2, 2020): Update: sorry I didn't read it properly before. It works great now!
Author
Owner

@avdi commented on GitHub (Jan 30, 2021):

Pleeeeeeeeeese 🙏

I make screencasts and I normally disable cursor blink in my editors and terminals so that I can speed up, slow down, and freeze video without distracting changes in cursor blink rate.

@avdi commented on GitHub (Jan 30, 2021): Pleeeeeeeeeese 🙏 I make screencasts and I normally disable cursor blink in my editors and terminals so that I can speed up, slow down, and freeze video without distracting changes in cursor blink rate.
Author
Owner

@rivy commented on GitHub (Apr 14, 2021):

An easy-to-use work-around...

@rem cursor.cmd ~ `cursor [[block | underline | bar] [blink]]"`
@setLocal
@echo off

:: set cursor style (via ANSI escape sequence)
:: * ref: [Cursor Escape Sequences](https://github.com/MicrosoftDocs/Console-Docs/issues/140)
:: * ref: https://github.com/microsoft/terminal/issues/1379#issuecomment-735679639

set "seq=[0 q" &::rem "default cursor"
if /i "%~1"=="block" set "seq=[2 q"
if /i "%~1"=="underline" set "seq=[4 q"
if /i "%~1"=="bar" set "seq=[6 q"
if /i "%~1"=="block" if /i "%~2"=="blink" set "seq=[1 q"
if /i "%~1"=="underline" if /i "%~2"=="blink" set "seq=[3 q"
if /i "%~1"=="bar" if /i "%~2"=="blink" set "seq=[5 q"

set "cursorOnSeq=[?25h"

@REM powershell -noninteractive -noprofile -command [char]27+'%seq%'
powershell -noninteractive -noprofile -command write-host -NoNewLine "$([char]27+'%seq%')$([char]27+'%cursorOnSeq%')"```
@rivy commented on GitHub (Apr 14, 2021): An easy-to-use work-around... ```batch @rem cursor.cmd ~ `cursor [[block | underline | bar] [blink]]"` @setLocal @echo off :: set cursor style (via ANSI escape sequence) :: * ref: [Cursor Escape Sequences](https://github.com/MicrosoftDocs/Console-Docs/issues/140) :: * ref: https://github.com/microsoft/terminal/issues/1379#issuecomment-735679639 set "seq=[0 q" &::rem "default cursor" if /i "%~1"=="block" set "seq=[2 q" if /i "%~1"=="underline" set "seq=[4 q" if /i "%~1"=="bar" set "seq=[6 q" if /i "%~1"=="block" if /i "%~2"=="blink" set "seq=[1 q" if /i "%~1"=="underline" if /i "%~2"=="blink" set "seq=[3 q" if /i "%~1"=="bar" if /i "%~2"=="blink" set "seq=[5 q" set "cursorOnSeq=[?25h" @REM powershell -noninteractive -noprofile -command [char]27+'%seq%' powershell -noninteractive -noprofile -command write-host -NoNewLine "$([char]27+'%seq%')$([char]27+'%cursorOnSeq%')"```
Author
Owner

@strawhat-dev commented on GitHub (Apr 17, 2021):

For those wondering, the easiest way I've found to disable the blinking cursor is by putting echo -en "\e[2 q" at the end of your .bashrc/.zshrc file (or Write-Host -NoNewLine "`e[2 q" at the end of your profile.ps1 for PowerShell users). This way, they get called upon startup. As a bonus, the -n/-NoNewLine flag removes the extra new line that appears on startup which bugged me a little.

@strawhat-dev commented on GitHub (Apr 17, 2021): For those wondering, the easiest way I've found to disable the blinking cursor is by putting `echo -en "\e[2 q"` at the end of your `.bashrc`/`.zshrc` file (or ```Write-Host -NoNewLine "`e[2 q"``` at the end of your `profile.ps1` for PowerShell users). This way, they get called upon startup. As a bonus, the `-n`/`-NoNewLine` flag removes the extra new line that appears on startup which bugged me a little.
Author
Owner

@rivy commented on GitHub (Apr 17, 2021):

You can alternatively use non-standard command lines to start a given shell, such as "commandline": "cmd.exe /k cursor bar" (using cursor.cmd from my prior post).

@rivy commented on GitHub (Apr 17, 2021): You can alternatively use non-standard command lines to start a given shell, such as `"commandline": "cmd.exe /k cursor bar"` (using `cursor.cmd` from my prior post).
Author
Owner

@fweep commented on GitHub (May 22, 2021):

This suggest that blinking or not should be a part of cursor shape.

Please not this. I very much want a bar cursor that doesn't blink.

@fweep commented on GitHub (May 22, 2021): > This suggest that blinking or not should be a part of cursor shape. Please not this. I very much want a bar cursor that doesn't blink.
Author
Owner

@LoganDark commented on GitHub (Jun 14, 2021):

Still waiting on this. A cursor blink is extremely obnoxious while looking at the terminal and trying to read text, Windows Terminal is still extremely limited in its customization options and basic features like this should not be backlogged. Please reconsider your stance on this, cursor blink in text boxes has nothing to do with cursor blink in terminals, so my terminal blink should not be controlled by that global setting.

@LoganDark commented on GitHub (Jun 14, 2021): Still waiting on this. A cursor blink is extremely obnoxious while looking at the terminal and trying to read text, Windows Terminal is still extremely limited in its customization options and basic features like this should _not_ be backlogged. Please reconsider your stance on this, cursor blink in text boxes has nothing to do with cursor blink in terminals, so my terminal blink should not be controlled by that global setting.
Author
Owner

@divijan commented on GitHub (Jul 5, 2021):

For those wondering, the easiest way I've found to disable the blinking cursor is by putting echo -e -n "\e[2 q" at the end of your .bashrc/.zshrc file (or Write-Host -NoNewLine "`e[2 q" at the end of your profile.ps1 for PowerShell users). This way, they get called upon startup. As a bonus, the -n/-NoNewLine flag removes the extra new line that appears on startup which bugged me a little.

worked like charm on Ubuntu WSL2 👍 Thanks

@divijan commented on GitHub (Jul 5, 2021): > > > For those wondering, the easiest way I've found to disable the blinking cursor is by putting `echo -e -n "\e[2 q"` at the end of your .bashrc/.zshrc file (or `` Write-Host -NoNewLine "`e[2 q" `` at the end of your profile.ps1 for PowerShell users). This way, they get called upon startup. As a bonus, the -n/-NoNewLine flag removes the extra new line that appears on startup which bugged me a little. worked like charm on Ubuntu WSL2 👍 Thanks
Author
Owner

@wiwiiwiii commented on GitHub (Jul 16, 2021):

Is there any workaround here yet without changing my shell startup file? I tried it and it smh broke some of my vim plugins. PLZ make it a customizable options for WT.😢

@wiwiiwiii commented on GitHub (Jul 16, 2021): Is there any workaround here yet without changing my shell startup file? I tried it and it smh broke some of my vim plugins. PLZ make it a customizable options for WT.😢
Author
Owner

@zeroxia commented on GitHub (Jul 19, 2021):

without resorting to any system-wide hack.

The problem is that there is no acceptable system-wide hack to resort to. If you disable cursor blink globally, you'll end up with broken taskbar icon notifications. Icons will glow orange permanently.

Microsoft can integrate Linux because it's freshly new project. But it's really hard for them to cooperate internally among different teams to fix some stupidly trivial but tremendously annoying glitches like this. This problem was reported years ago and I just have it on Windows 10 20H2 build 19042.

https://superuser.com/questions/1114598/windows-10-taskbar-icons-dont-stop-glowing-orange

https://www.reddit.com/r/Windows10/comments/4qlgqp/taskbar_icons_stay_highlighted_orange_forever/

@zeroxia commented on GitHub (Jul 19, 2021): > > without resorting to any system-wide hack. > > The problem is that there is no acceptable system-wide hack to resort to. If you disable cursor blink globally, you'll end up with broken taskbar icon notifications. Icons will glow orange permanently. Microsoft can integrate Linux because it's freshly new project. But it's really hard for them to cooperate internally among different teams to fix some stupidly trivial but tremendously annoying glitches like this. This problem was reported years ago and I just have it on Windows 10 20H2 build 19042. https://superuser.com/questions/1114598/windows-10-taskbar-icons-dont-stop-glowing-orange https://www.reddit.com/r/Windows10/comments/4qlgqp/taskbar_icons_stay_highlighted_orange_forever/
Author
Owner

@Avi0 commented on GitHub (Jul 21, 2021):

The workaround is to disable cursor blinking system-wide and disable taskbar animations in System Properties, Advanced, Visual Effects (to avoid stuck icon highlighting in the taskbar).

@Avi0 commented on GitHub (Jul 21, 2021): The workaround is to disable cursor blinking system-wide and disable taskbar animations in System Properties, Advanced, Visual Effects (to avoid stuck icon highlighting in the taskbar).
Author
Owner

@wiwiiwiii commented on GitHub (Jul 23, 2021):

It's weird that I have done nothing and it just stopped blinking anymore since today.

@wiwiiwiii commented on GitHub (Jul 23, 2021): It's weird that I have done nothing and it just stopped blinking anymore since today.
Author
Owner

@wiwiiwiii commented on GitHub (Sep 5, 2021):

It's weird that I have done nothing and it just started blinking again since today.

@wiwiiwiii commented on GitHub (Sep 5, 2021): It's weird that I have done nothing and it just started blinking again since today.
Author
Owner

@LoganDark commented on GitHub (Sep 5, 2021):

@willchao612 A story in two comments...

@LoganDark commented on GitHub (Sep 5, 2021): @willchao612 A story in two comments...
Author
Owner

@wiwiiwiii commented on GitHub (Sep 5, 2021):

Finally got a solution. If you are using tmux and this cursor blinking issue happens, put the following line in your .tmux.conf and restart your tmux session.

set -sa terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'

Found this by chance when solving another cursor shape issue in Neovim. Docs here. I hope it helps you guys.

@wiwiiwiii commented on GitHub (Sep 5, 2021): Finally got a solution. If you are using tmux and this cursor blinking issue happens, put the following line in your `.tmux.conf` and restart your tmux session. ```tmux set -sa terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q' ``` Found this by chance when solving another cursor shape issue in Neovim. [Docs](https://neovim.io/doc/user/term.html#tui-cursor-tmux) here. I hope it helps you guys.
Author
Owner

@zakutin commented on GitHub (Sep 6, 2021):

It's weird that I have done nothing and it just stopped blinking anymore since today.

I noticed the following:

  • launch wt, cursor is blinking
  • run neovim (by default the cursor is not blinking in neovim)
  • exit neovim
  • cursor is not blinking in wt command line
  • restart wt, cursor is blinking again
@zakutin commented on GitHub (Sep 6, 2021): > > > It's weird that I have done nothing and it just stopped blinking anymore since today. I noticed the following: * launch wt, cursor is blinking * run neovim (by default the cursor is not blinking in neovim) * exit neovim * cursor is _not blinking_ in wt command line * restart wt, cursor is blinking again
Author
Owner

@wiwiiwiii commented on GitHub (Sep 7, 2021):

@zakutin Did you manually set TERM in you startup file? If so, try commenting it out and restart tmux.

@wiwiiwiii commented on GitHub (Sep 7, 2021): @zakutin Did you manually set TERM in you startup file? If so, try commenting it out and restart tmux.
Author
Owner

@zadjii-msft commented on GitHub (Sep 7, 2021):

FWIW This probably got better in some ways in #10543/#10589, and worse in others: #10754

@zadjii-msft commented on GitHub (Sep 7, 2021): FWIW This probably got better in some ways in #10543/#10589, and worse in others: #10754
Author
Owner

@ZYinMD commented on GitHub (May 18, 2022):

Hey guys, maybe a dumb question but: does the cursor in Linux blink by default?

I use the cursor shape to remind myself where I am - in cmd and pwsh I use a blinking underscore, in git bash I use a blinking pipe, in WSL I use a block. Those are their original default shapes, so I try to keep them.

So, now the question is, if I want my Ubuntu to look authentic, should I make the block blink or not blink?

@ZYinMD commented on GitHub (May 18, 2022): Hey guys, maybe a dumb question but: does the cursor in Linux blink by default? I use the cursor shape to remind myself where I am - in cmd and pwsh I use a blinking underscore, in git bash I use a blinking pipe, in WSL I use a block. Those are their original default shapes, so I try to keep them. So, now the question is, if I want my Ubuntu to look authentic, should I make the block blink or not blink?
Author
Owner

@niask11 commented on GitHub (May 18, 2022):

Hey guys, maybe a dumb question but: does the cursor in Linux blink by default?

In Ubuntu Desktop it's a block and it doesn't blink as far as I remember...

@niask11 commented on GitHub (May 18, 2022): > Hey guys, maybe a dumb question but: does the cursor in Linux blink by default? In Ubuntu Desktop it's a block and it doesn't blink as far as I remember...
Author
Owner

@dkter commented on GitHub (May 18, 2022):

@ZYinMD in GNOME Terminal (the default terminal in Ubuntu) the cursor is a blinking solid block, in the TTY (i.e. if you run Ubuntu without a GUI) it's a blinking underscore

@dkter commented on GitHub (May 18, 2022): @ZYinMD in GNOME Terminal (the default terminal in Ubuntu) the cursor is a blinking solid block, in the TTY (i.e. if you run Ubuntu without a GUI) it's a blinking underscore
Author
Owner

@mataha commented on GitHub (May 12, 2023):

Hi! For those subscribed to this thread and many more coming from search results like me, I have a cmd.exe solution ready.

The code
@setlocal EnableDelayedExpansion EnableExtensions & set "CMD=!CMDCMDLINE!" 2>nul
@if /i not "!CMD!"=="!CMD:/=!" (goto :EOF) else @if not defined DEBUG (echo off)

for /f "usebackq" %%E in (`echo(prompt $E^| "%ComSpec%" /d /q "" 2^>nul`) do (
    echo(%%~E[?12l %%~E[3A %%~E[3M %%~E[1A
)

Save the above to ~\.cmd as UTF-8, then run:

set PROCESSOR_ARCHITECTURE | "%SystemRoot%\system32\find.exe" "64" >nul && (
    set "registry_view=64") || set "registry_view=32"

reg add "HKCU\Software\Microsoft\Command Processor" ^
    /v "AutoRun" /t "REG_EXPAND_SZ" /f /reg:%registry_view% ^
    /d "@if exist """^%USERPROFILE^%\.cmd""" """^%USERPROFILE^%\.cmd""""
Explanation

From Console Virtual Terminal Sequences: ESC [ ? 12 l disables text cursor blinking. The problem is then twofold:

  • emit said sequence within a terminal
  • make the operation persistent on startup

There are many ways of generating ESC within cmd.exe, but the cleanest method involves printing it with the prompt internal command:

for /f "usebackq" %%E in (`echo(prompt $E^| "%ComSpec%"`) do set esc=%%~E
  1. prompt $E sets the current prompt to an ESC character.
  2. echo that command and pipe it to the default command interpreter (cmd.exe) that's stored in a global environment variable ComSpec to make it set a new prompt and output it. Why echo with an unclosed parenthesis? For a multitude of good reasons.
  3. Execute the above in a subshell (within backticks, like other commonplace shells) and store the output in a for /f variable named E. As the contents of the command are going to be evaluated again, that | has to be escaped. The tilde is technically not necessary (it serves the purpose of removing surrounding double quotes), but is considered good practice.
  4. As that is going to run within a context of a batch script, double all the %s.

With ESC in a variable we're free to disable blinking permanently:

echo(%esc%[?12l %esc%[3A %esc%[3M %esc%[1A

In order:

  1. Do what we came here for. This will spew some rubbish to the buffer. (todo control execution order)
  2. Move the cursor up by three lines so that all of the crap printed is either below or on the same line.
  3. Erase 3 lines from the buffer starting from the position we're on, cleaning up the screen.
  4. Finally, move the cursor up by a line. This is not necessary, but it will cleanly separate prompt from startup information when the control returns.

From here we're off to making said changes persistent - with cmd.exe's help (literally - cmd /?):

If /D was NOT specified on the command line, then when CMD.EXE starts, it
looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
either or both are present, they are executed first.

    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun

        and/or

    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

Make the content of that registry variable execute a script of our choice if it exists:

set PROCESSOR_ARCHITECTURE | "%SystemRoot%\system32\find.exe" "64" >nul && (
    set "registry_view=64") || set "registry_view=32"

reg add "HKCU\Software\Microsoft\Command Processor" ^
    /v "AutoRun" /t "REG_EXPAND_SZ" /reg:%registry_view% ^
    /d "@if exist """^%USERPROFILE^%\.cmd""" """^%USERPROFILE^%\.cmd""""

Such file probably isn't present yet, so create a .cmd file in the current user's home directory:

type nul >"%USERPROFILE%\.cmd"

And populate it with the following:

@setlocal EnableDelayedExpansion EnableExtensions & set "CMD=!CMDCMDLINE!" 2>nul
@if /i not "!CMD!"=="!CMD:/=!" (goto :EOF) else @if not defined DEBUG (echo off)

for /f "usebackq" %%E in (`echo(prompt $E^| "%ComSpec%" /d /q "" 2^>nul`) do (
    echo(%%~E[?12l %%~E[3A %%~E[3M %%~E[1A
)

Take note that this script will run every time an instance of cmd.exe starts. That involves all subshells, including both the one we're getting an ESC character from and the one wrapping the whole command. To prevent that, we're creating a kind of a header guard in the first two lines - it will exit immediately if the currently executing command contains slashes (as subshells are basically cmd /c <backtick_content>). That doesn't involve the instance we're piping the prompt command to, thus a /d switch is added to prevent it from executing any startup scripts.

todo debugging machinery, explanation of delayed expansion and cmd /q 2>nul, exit label, @ operator, sleep

Preview

https://github.com/microsoft/terminal/assets/7210216/e77b007f-5926-4127-87bb-0c721a39bf53

@mataha commented on GitHub (May 12, 2023): Hi! For those subscribed to this thread and many more coming from search results like me, I have a `cmd.exe` solution ready. <details> <summary>The code</summary> ```batchfile @setlocal EnableDelayedExpansion EnableExtensions & set "CMD=!CMDCMDLINE!" 2>nul @if /i not "!CMD!"=="!CMD:/=!" (goto :EOF) else @if not defined DEBUG (echo off) for /f "usebackq" %%E in (`echo(prompt $E^| "%ComSpec%" /d /q "" 2^>nul`) do ( echo(%%~E[?12l %%~E[3A %%~E[3M %%~E[1A ) ``` Save the above to `~\.cmd` as UTF-8, then run: ```batchfile set PROCESSOR_ARCHITECTURE | "%SystemRoot%\system32\find.exe" "64" >nul && ( set "registry_view=64") || set "registry_view=32" reg add "HKCU\Software\Microsoft\Command Processor" ^ /v "AutoRun" /t "REG_EXPAND_SZ" /f /reg:%registry_view% ^ /d "@if exist """^%USERPROFILE^%\.cmd""" """^%USERPROFILE^%\.cmd"""" ``` </details> <details> <summary>Explanation</summary> From [Console Virtual Terminal Sequences](https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences): `ESC [ ? 12 l` disables text cursor blinking. The problem is then twofold: - emit said sequence within a terminal - make the operation persistent on startup There are many ways of generating ESC within `cmd.exe`, but the cleanest method involves printing it with the [`prompt`](https://ss64.com/nt/prompt.html) internal command: ```batchfile for /f "usebackq" %%E in (`echo(prompt $E^| "%ComSpec%"`) do set esc=%%~E ``` 1. `prompt $E` sets the current prompt to an ESC character. 2. `echo` that command and pipe it to the default command interpreter (`cmd.exe`) that's stored in a global environment variable `ComSpec` to make it set a new prompt and output it. Why `echo` with an unclosed parenthesis? [For a multitude of good reasons.](https://www.dostips.com/forum/viewtopic.php?p=4554#p4554) 3. Execute the above in a subshell (within backticks, like other commonplace shells) and store the output in a `for /f` variable named `E`. As the contents of the command are going to be evaluated again, that `|` has to be escaped. The tilde is technically not necessary (it serves the purpose of removing surrounding double quotes), but is considered good practice. 4. As that is going to run within a context of a batch script, double all the `%`s. With ESC in a variable we're free to disable blinking permanently: ```batchfile echo(%esc%[?12l %esc%[3A %esc%[3M %esc%[1A ``` In order: 1. Do what we came here for. This will spew some rubbish to the buffer. (todo control execution order) 2. Move the cursor up by three lines so that all of the crap printed is either below or on the same line. 3. Erase 3 lines from the buffer starting from the position we're on, cleaning up the screen. 4. Finally, move the cursor up by a line. This is not necessary, but it will cleanly separate prompt from startup information when the control returns. From here we're off to making said changes persistent - with `cmd.exe`'s help (literally - `cmd /?`): ``` If /D was NOT specified on the command line, then when CMD.EXE starts, it looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if either or both are present, they are executed first. HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun and/or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun ``` Make the content of that registry variable execute a script of our choice if it exists: ```batchfile set PROCESSOR_ARCHITECTURE | "%SystemRoot%\system32\find.exe" "64" >nul && ( set "registry_view=64") || set "registry_view=32" reg add "HKCU\Software\Microsoft\Command Processor" ^ /v "AutoRun" /t "REG_EXPAND_SZ" /reg:%registry_view% ^ /d "@if exist """^%USERPROFILE^%\.cmd""" """^%USERPROFILE^%\.cmd"""" ``` Such file probably isn't present yet, so create a `.cmd` file in the current user's home directory: ```batchfile type nul >"%USERPROFILE%\.cmd" ``` And populate it with the following: ```batchfile @setlocal EnableDelayedExpansion EnableExtensions & set "CMD=!CMDCMDLINE!" 2>nul @if /i not "!CMD!"=="!CMD:/=!" (goto :EOF) else @if not defined DEBUG (echo off) for /f "usebackq" %%E in (`echo(prompt $E^| "%ComSpec%" /d /q "" 2^>nul`) do ( echo(%%~E[?12l %%~E[3A %%~E[3M %%~E[1A ) ``` Take note that this script will run every time an instance of `cmd.exe` starts. That involves **all subshells**, including both the one we're getting an ESC character from and the one wrapping the whole command. To prevent that, we're creating a kind of a header guard in the first two lines - it will exit immediately if the currently executing command contains slashes (as subshells are basically `cmd /c <backtick_content>`). That doesn't involve the instance we're piping the prompt command to, thus a `/d` switch is added to prevent it from executing any startup scripts. todo debugging machinery, explanation of delayed expansion and `cmd /q 2>nul`, exit label, `@` operator, sleep </details> <details> <summary>Preview</summary> https://github.com/microsoft/terminal/assets/7210216/e77b007f-5926-4127-87bb-0c721a39bf53 </details>
Author
Owner

@GeekDuanLian commented on GitHub (Oct 29, 2023):

For those using bash, add this to your ~/.bashrc:
printf '\e[?12l'

@GeekDuanLian commented on GitHub (Oct 29, 2023): For those using `bash`, add this to your `~/.bashrc`: `printf '\e[?12l'`
Author
Owner

@lost22git commented on GitHub (May 26, 2024):

For those using WindowsPowerShell/pwsh, add this to your $PROFILE

echo "`e[?12l"
@lost22git commented on GitHub (May 26, 2024): For those using WindowsPowerShell/pwsh, add this to your `$PROFILE` ```powershell echo "`e[?12l" ```
Author
Owner

@abhbh commented on GitHub (Aug 17, 2024):

For Nushell users, add the following to your config.nu

print "\e[?12l"
@abhbh commented on GitHub (Aug 17, 2024): For Nushell users, add the following to your `config.nu` ``` print "\e[?12l" ```
Author
Owner

@densalo commented on GitHub (Aug 17, 2024):

On windows 10 with windows terminal 1.20.11781.0 and PowerShell 7.4.4
I have not been able to stop cursor blinking.
I've tried all forms of e[ but it doesn't seem to do anything.

@densalo commented on GitHub (Aug 17, 2024): On windows 10 with windows terminal 1.20.11781.0 and PowerShell 7.4.4 I have not been able to stop cursor blinking. I've tried all forms of *e[* but it doesn't seem to do anything.
Author
Owner

@atrme commented on GitHub (Dec 16, 2024):

On windows 10 with windows terminal 1.20.11781.0 and PowerShell 7.4.4 I have not been able to stop cursor blinking. I've tried all forms of e[ but it doesn't seem to do anything.

You may try this instead since "`e" doesn't work on newer versions of Powershell

$esc = char[0x1b]  
Write-Host -n "${esc}[2 q"
@atrme commented on GitHub (Dec 16, 2024): > On windows 10 with windows terminal 1.20.11781.0 and PowerShell 7.4.4 I have not been able to stop cursor blinking. I've tried all forms of _e[_ but it doesn't seem to do anything. You may try this instead since "\`e" doesn't work on newer versions of Powershell $esc = char[0x1b] Write-Host -n "${esc}[2 q"
Author
Owner

@DHowett commented on GitHub (Dec 16, 2024):

"`e" doesn't work on newer versions of Powershell

Older versions.

"`e" only works on newer versions of Powershell.

@DHowett commented on GitHub (Dec 16, 2024): > "`e" doesn't work on newer versions of Powershell Older versions. "`e" **only** works on newer versions of Powershell.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1834