Repository navigation
Description
ConPTY leaves the cursor one row above the prompt after an interactive program starts at the bottom of a full screen
Windows Terminal version
OpenConsole.exe 1.26.2609.30004 used as ConPTY host (same with 1.24.x and 1.25.2609.30003). Inbox conhost.exe does not reproduce.
Windows build number
10.0.19045.5371
Other software
Any ConPTY client (reproduced with our own terminal emulator; the bytes below come straight from the PTY output pipe). Python 3.11 (python -q), parent shell cmd.exe (also reproduces with MSYS2 bash).
Steps to reproduce
- Create a pseudoconsole 112x33 hosted by OpenConsole.exe and run
cmd.exe. - Fill the screen so the prompt sits on the last row, e.g.
for /l %i in (1,1,120) do @echo %i. - Type
python -qand press Enter (the echoed command line is on row 33, the CRLF scrolls it to row 32). - When
>>>appears, typee.
Expected behavior
>>> and the typed e stay on row 33; row 32 still shows the command line.
Actual behavior
ConPTY first draws >>> on row 33, then sends a full repaint whose rows 28-32 and the >>> on row 33 are correct, but it ends with ESC[32;5H, so its cursor is one row above its own prompt. The next keystroke is rendered as >>> e over the start of the command line on row 32 (C:\re replaced, pos\... kept), and row 33 is left with a stale prompt.
Relevant PTY output (escaped, timestamps in seconds):
0.0111 ESC[33;43H"...python.exe" -q ESC[33;112H
0.0111 ESC[33;112H \r\n
0.8082 ESC[0m >>> ESC[?25l ESC[33;1H ESC[0m >>>
0.8082 ESC7 ESC[1;1H ...blank rows 1-33... ESC[1;1H 91 ... ESC[28;1H 118 ESC[29;1H 119 ESC[30;1H 120
ESC[31;1H (blank) ESC[32;1H C:\repos\...>"...python.exe" -q ESC[33;5H (blank) ESC[32;5H <-- wrong row
The client sent no input (no DSR/CPR reply, no resize) between the Enter and the repaint. A full byte trace is available on request.
Possibly related
- Terminal cursor is sometimes positioned near the beginning of the prompt instead of at the end vscode#324914 (Jul 2026, Windows 11 26100): cursor sometimes lands near the start of the prompt and typed text goes there; same symptom, no root cause posted.
- ConPTY: Non-DECCRA/DECFRA scrolling produces incorrect results #20773 / PR Fix several ScrollConsoleScreenBuffer ConPTY issues #20774 "Fix several ScrollConsoleScreenBuffer ConPTY issues" (cherry-picked to 1.25/1.26 servicing on Oct 26, 2026). Our build 1.26.2609.30004 predates it; this bug also shows on 1.24, so it may be a separate issue, but we could not test a build containing Fix several ScrollConsoleScreenBuffer ConPTY issues #20774.
- Not the same as Incorrect cursor position on full lines #15888 (closed by A minor ConPTY refactoring: Goodbye VtEngine Edition #17510; full-line cursor column with pwsh).
Activity
AnubhavMaheshwari commentedon Nov 4, 2026
Hi, I'd like to investigate and work on this issue. I can reproduce the problem using ConPTY and would like to contribute a fix along with regression tests. Please let me know if this issue is available for contribution.
DHowett commentedon Nov 4, 2026
Anubhav Maheshwari (@AnubhavMaheshwari) the issue was first filed only TWENTY MINUTES AGO. Cool your jets, son.