question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Console Host redraws the current line after every character

See original GitHub issue

Steps 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:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
DHowettcommented, Aug 18, 2016

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.

0reactions
iSazonovcommented, Apr 13, 2017

@masaeedu I cannot repo this. So you can open Issue in this repo. Later we can move it in PSReadLine repo.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found