Console Host redraws the current line after every character
See original GitHub issueSteps to reproduce
Launch powershell. Type a command. Observe that the cursor flickers left and right, back and forth, for every character you type. This may require a terminal with slower refresh.
Expected behavior
The input is only redrawn when it becomes necessary.
Actual behavior
The input is redrawn for every input character.
I profiled this, and found that for the input (and output):
PS > powershell redraws a lot
… which is a paltry few bytes, we emit 52,501 bytes of ANSI escape sequences repositioning the cursor, drawing colours, repositioning the cursor some more, etc.
Environment data
root@f49460ec9455:/# powershell -c '$PSVersionTable'
Name Value
---- -----
PSVersion 6.0.0-alpha
PSEdition Core
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 3.0.0.0
GitCommitId v6.0.0-alpha.9
CLRVersion
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
java - Erase multiple console lines with console characters
So I'm aware that with console characters you can return the cursor to the beginning of the current line ( \r ) or...
Read more >Terminal screen redraw issues when ssh-ing from WSL2 ...
My windows machine updated the other night and now I'm having weird terminal issues when I ssh to a remote host from a...
Read more >Changes to the Windows Console in Windows Server
If the cursor in the line currently being edited, use this command once to extend the selection to the character immediately after the...
Read more >Introducing the Windows Pseudo Console (ConPTY)
In this, the fourth post in the Windows Command-Line series, we'll discuss the new Windows Pseudo Console (ConPTY) infrastructure and API ...
Read more >resizable serial console window?
When using the serial console of my system I always end up with $COLUMNS=80 and $LINES=24 . While I can change these variables...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thought: perhaps this is to mimic the Windows console’s support for drawing characters at any coordinates (without cursor moves)? It looks like we could be trying to do the same thing, but because it’s being used to such a high degree we’re emitting a veritable boatload of CSIs.
It’s especially noticeable over remote links with nonzero latency.
@masaeedu I cannot repo this. So you can open Issue in this repo. Later we can move it in PSReadLine repo.