-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Problems with cursor position escape #18117
Comments
I would love to work on this issue. |
Keeping the Triage tag on, but this may be of interest to @lhecker |
Thanks for filing. A few questions from the team:
|
@carlos-zamora I'm not sure if this is exactly the same thing, but I can reproduce similar behavior with a batch file like this: @echo �[6n
@set /p "x=RESPONSE:" NB: The If you run that from within an open terminal window, you'll get the expected
But if you try and run the the script by double clicking on the file in Windows Explorer, it'll open up in the terminal, and you'll see the Interestingly the problem appears to be specific to the |
This will hang it for me: #define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <stdio.h>
int main() {
const HANDLE input = GetStdHandle(STD_INPUT_HANDLE);
DWORD input_mode_old;
GetConsoleMode(input, &input_mode_old);
SetConsoleMode(input, ENABLE_PROCESSED_INPUT | ENABLE_VIRTUAL_TERMINAL_INPUT);
for (unsigned long long i = 0;; i++) {
printf("%llu \x1b[6n", i);
char byte;
DWORD chrs;
do {
if (!ReadConsoleA(input, &byte, 1, &chrs, NULL) || chrs == 0) {
goto exit;
}
if (byte < 0x20 || byte >= 0x7f) {
printf("\\x%02x", byte);
} else {
printf("%c", byte);
}
} while (byte != 'R');
printf("\n");
}
exit:
SetConsoleMode(input, input_mode_old);
return 0;
} |
That is an excellent repro! It really hangs almost immediately. |
Windows Terminal version
1.22.2912.0
Windows build number
10.0.22631.4196
Other Software
https://github.com/cracyc/msdos-player/blob/vt/msdos.cpp#L1088
Steps to reproduce
Start it in a new console window or run in an existing one and execute a command with lots of output.
Expected Behavior
No response
Actual Behavior
When the program starts it immediately gets the console window size and the cursor position which hangs forever. If run from an existing console window it starts fine but if say command.com is run and dir then it will randomly hang waiting for the reply to ESC [6n, although it will resume after a bit or a key is pressed. This does not happen on terminal version 1.21.2911.0, in legacy conhost or if GetConsoleScreenBufferInfo is used instead.
The text was updated successfully, but these errors were encountered: