Am 28.08.2025 um 05:36 schrieb Thomas Wolff via Cygwin:
When running wsl.exe from mintty, typing ^O corrupts terminal display.
This was reported in
https://github.com/mintty/mintty/issues/1332
and I later reported it towards Windows conpty
https://github.com/microsoft/terminal/issues/19285
but conpty is unlikely the cause, as testing suggests.
Test case, in mintty:
wsl
ls -1 /bin
^O # enter the control character
ls -1 /bin # repeat
The same happens in xterm and some other terminals, but not all.
Mintty uses a loop to read terminal output from the pty and fill its
buffer:
do {
int ret = read(pty_fd, buf + len, sizeof buf - len);
if (ret > 0)
len += ret;
else
break;
} while (len < sizeof buf);
Tracing the loop shows that, while running wsl, after having entered
^O, every subsequent read returns -1.
Taking out the loop (by patching it, or currently by using option Baud
with some high value) fixes the problem.
I suspect some very obscure interworking problem between wsl/conpty
and cygwin pty handling. As noted in the latter issue, it does not
happen with terminals running remotely, so the suspicion goes more to
the cygwin side.
What’s the role of ^O in this puzzle? Does it trigger something in
cygwin?
Is there anything peculiar that would cause pty chunks not be
recognised and then skipped in such a loop?
Thomas
I've tested this behaviour does not occur with cygwin 3.3.4 but it does
with cygwin 3.3.5.
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple