-
Notifications
You must be signed in to change notification settings - Fork 315
Description
Environment
From conhost:
PS version: 7.0.0
PSReadline version: 2.0.0
os: 10.0.19601.1000 (WinBuild.160101.0800)
PS file version: 7.0.0.0
HostName: ConsoleHost
BufferWidth: 248
BufferHeight: 68
Additionally, from WT:
PS version: 7.0.0
PSReadline version: 2.0.0
os: 10.0.19601.1000 (WinBuild.160101.0800)
PS file version: 7.0.0.0
HostName: ConsoleHost (Windows Terminal)
BufferWidth: 120
BufferHeight: 30
Steps to reproduce
See microsoft/terminal#2432 and microsoft/terminal#5254
Windows Terminal Repro
- Open Terminal in full screen
- Type
ls
- unmaximize the window
- maximize the window
- type
ls
again and see that ls is not positioned correctly
Conhost repro
With a plain old conhost:
- Maximize it
- Run
ls
- Restore down
- Change the buffer size to match the window size
- Maximize again
Expected behavior
Text appears at previous cursor line
Actual behavior
Text appears in blank space. Screenshots of process:
Notes
I'm moving this here because I'm having a hard time tracing through this from our side, and I figured it'd be easier to get help straight from the experts. From my own investigation
This issue: PowerShell/PSReadLine#682
and the associated PR: PowerShell/PSReadLine#694Which pointed me to this function
PowerShell/PSReadLine:PSReadLine/Render.cs@198a643
#L985-L1000I can't be sure that's actually it, but that's certainly something to look into.
Though, reading through that, it looks like
_console.CursorTop
might already be wrong at that point in the call. Looks like that function is just trying to see how many rows the input line takes, then is setting the_initialY
to be that many rows above the cursor. So I'd think the cursor was already wrong at this point.I'll keep digging