Terminal: Suppress cursor blinking when text is actively being printed

Created on 31 May 2019  路  6Comments  路  Source: microsoft/terminal

Here's an edge case I didn't cover in #686 - though it might warrant its own issue anyway.

Environment

Windows build number: 10.0.18362.145
Windows Terminal version (if applicable): commit 71e19cd82528d66a0a7867cbed85990cfc1685f1

Any other software?

Steps to reproduce

Print a lot of text to the console. This is especially apparent with progress bars that require backspace characters.

Actual behavior

The cursor continues to blink, or if the cursor blinking is turned off it stays on. This leads to some weird behaviour:

2019-05-31_17-20-01
2019-05-31_17-27-22

Expected behavior

I'm thinking the cursor should automatically hide when printing text. I've seen this done in a few other terminal programs.

Area-Rendering Help Wanted Issue-Task Priority-3 Product-Terminal v1-Scrubbed

Most helpful comment

Yea I had a PR internally for properly rendering the cursor state with conpty before moving to open source, but I don't think I ever followed up on it since the move. I'll need to port it out here

All 6 comments

This would probably be more adequately handled by supporting cursor off/on sequences in ConPTY, right? It seems most ideal that an application printing a progress bar would turn off the cursor before doing so.

@DHowett-MSFT I didn't even know that there were sequences to toggle the cursor on/off! That would definitely be the ideal approach.

Upon further investigation, it looks like most terminals (including conhost) show the cursor when text is being printed (except when the cursor toggle sequences are used). This isn't a major issue, but try gci C:\Windows\System32 -- it looks a bit weird to have the cursor still blinking. Resetting the cursor timer might provide a smoother experience, but I'm not sure what the impact would be on the output performance.

I'll leave this open and open a new issue for cursor show/hide sequences it looks like there's already an issue for discussing ANSI escape sequences over at #138.

Yea I had a PR internally for properly rendering the cursor state with conpty before moving to open source, but I don't think I ever followed up on it since the move. I'll need to port it out here

You can see this behavior in htop under WSL. If you set your profile cursor to filledBox and use a standout cursor color like Magenta (don't knock it until you try it) #FF00FF then the bug really stands out.

+1 for enabling cursor on/off escape sequences, please! :) I.e., normally: \e[?25l to hide and \e[?25h to show.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DieselMeister picture DieselMeister  路  3Comments

mrmlnc picture mrmlnc  路  3Comments

TayYuanGeng picture TayYuanGeng  路  3Comments

zadjii-msft picture zadjii-msft  路  3Comments

dev-logan picture dev-logan  路  3Comments