Terminal settings are not correctly restored on repl exit #128330
Labels
stdlib
Python modules in the Lib dir
topic-repl
Related to the interactive shell
type-bug
An unexpected behavior, bug, or error
Bug report
Bug description:
I am working on updating the version of Python that ships in OmniOS -- an illumos distribution -- from 3.12 to 3.13 and have encountered a problem with terminal settings not being properly restored when exiting from the interactive interpreter prompt.
In particular, I see the EOF character changing from 0x4 (^D) to 0x1 (^A) after a trip through repl:
Using DTrace (we patch dtrace support back into python locally), I can see that all of the other settings are being restored, just not this particular control character. Here's an excerpt:
Here is the sequence that switches the terminal to raw mode. The trace shows
that
c_cc[4]
is being changed from 0x4 to 0x1. This isVMIN
so as expected.and here is where the terminal is restored:
Everything is being restored apart from that
c_cc[4]
. On illumos, VMIN andVEOF are both defined as 4, which is legitimate but different to some other
UNIX-like environments.
The bug here is that the list of control characters is not deep copied in
fancy_termios.py.
CPython versions tested on:
3.13
Operating systems tested on:
Other
Linked PRs
The text was updated successfully, but these errors were encountered: