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

Add support for turning off cursor blink #1379

Open
KiYugadgeter opened this issue Jun 22, 2019 · 58 comments
Open

Add support for turning off cursor blink #1379

KiYugadgeter opened this issue Jun 22, 2019 · 58 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Milestone

Comments

@KiYugadgeter
Copy link

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

@msftbot msftbot bot added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jun 22, 2019
@leptr
Copy link

leptr commented 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

@Lo0oG
Copy link

Lo0oG commented Jun 22, 2019

Go into the Control Panel and search for Blink.

@AeliusSaionji
Copy link

AeliusSaionji commented Jun 23, 2019

Seconding a request for this setting.

@DHowett-MSFT DHowett-MSFT changed the title How I can stop blink of cursor in Windows Terminal? Add support for turning off cursor blink Jun 24, 2019
@DHowett-MSFT DHowett-MSFT added Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. labels Jun 24, 2019
@msftbot msftbot bot removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 24, 2019
@DHowett-MSFT DHowett-MSFT added Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 24, 2019
@msftbot msftbot bot removed the Needs-Tag-Fix Doesn't match tag requirements label Jun 24, 2019
@leptr

This comment has been minimized.

@DHowett-MSFT

This comment has been minimized.

@leptr

This comment has been minimized.

@KiYugadgeter
Copy link
Author

KiYugadgeter commented Jun 26, 2019

You could see here.
#1294 (comment)

@AeliusSaionji
Copy link

AeliusSaionji commented Jun 26, 2019

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

@dkter
Copy link
Contributor

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

@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Jul 1, 2019
@KiYugadgeter
Copy link
Author

KiYugadgeter commented Jul 2, 2019

@SCWells72
Copy link

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

@KiYugadgeter
Copy link
Author

KiYugadgeter commented 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

@hwo411
Copy link

hwo411 commented Aug 18, 2019

Any ETA to add this?

@zadjii-msft
Copy link
Member

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

@hwo411
Copy link

hwo411 commented Sep 5, 2019

@zadjii-msft thanks for explanation!

@msftbot msftbot bot added the In-PR This issue has a related PR label Sep 25, 2019
@stanio
Copy link

stanio commented 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).

@ndavidpsi
Copy link

ndavidpsi commented Dec 2, 2020

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

@avdi
Copy link
Contributor

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

@rivy
Copy link

rivy commented 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%')"```

@strawhat-dev
Copy link

strawhat-dev commented 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.

@rivy
Copy link

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

@fweep
Copy link

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

@LoganDark
Copy link

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

@divijan
Copy link

divijan commented 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

@willchao612
Copy link

willchao612 commented 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.😢

@zeroxia

This comment has been minimized.

@Avi0
Copy link

Avi0 commented 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).

@willchao612
Copy link

willchao612 commented Jul 23, 2021

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

@willchao612
Copy link

willchao612 commented Sep 5, 2021

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

@LoganDark
Copy link

LoganDark commented Sep 5, 2021

@willchao612 A story in two comments...

@willchao612
Copy link

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

@zakutin
Copy link

zakutin commented 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

@willchao612
Copy link

willchao612 commented Sep 6, 2021

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

@zadjii-msft
Copy link
Member

zadjii-msft commented Sep 7, 2021

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

@zadjii-msft zadjii-msft modified the milestones: Terminal v2.0, 22H2 Jan 4, 2022
@zadjii-msft zadjii-msft added the Priority-2 A description (P2) label Jan 4, 2022
@ZYinMD
Copy link

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

@niask11
Copy link

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

@dkter
Copy link
Contributor

dkter commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.