-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Console Host redraws the current line after every character #1877
Comments
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. |
The current design exists to keep things simple - e.g. the color of text previously entered might change after typing a character. The current design also performs much better on Windows than the simple alternatives. At any rate, thanks for the report, this is a known issue that we definitely plan on addressing. |
This issue was moved to PowerShell/PSReadLine#469 |
@lzybkr Is there a workaround for this? Still seeing this in the latest container published on docker. I don't know if it's extra noticeable for me because my machine sucks, but it makes it very difficult to do any useful work. |
Nvm, just found it. For posterity: Remove-Module -Name PSReadline EDIT: While this works, make sure you don't use the up or down keys after removing the module or the session will crash. |
@masaeedu Thanks for your report! Please open Issue about the session crash. |
@iSazonov Is this another PSReadline bug or should I open it for this repo? |
@masaeedu If the crash happens without PSReadline the Issue is for this repo. |
@iSazonov The crash happens specifically when you remove PSReadLine from a running session, and I suspect the issue is that PSReadLine takes over some hooks for navigating history that don't get reset to their original state when you unload the module. In other words PSReadLine probably isn't designed to be You'd have to start up powershell without PSReadLine loaded at all to determine whether the problem is independent of PSReadLine, and I don't know how to do that. |
@masaeedu I cannot repo this. So you can open Issue in this repo. Later we can move it in PSReadLine repo. |
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):
... 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
The text was updated successfully, but these errors were encountered: