From: Andy Fiddaman Date: Thu, 23 Jan 2025 17:30:08 +0000 (+0000) Subject: gh-128330: Terminal control characters should be restored on repl exit (#128331) X-Git-Tag: v3.14.0a5~264 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b15d9c0d2d30c7d3f17ebb90dd822ef32f977cc;p=thirdparty%2FPython%2Fcpython.git gh-128330: Terminal control characters should be restored on repl exit (#128331) --- diff --git a/Lib/_pyrepl/fancy_termios.py b/Lib/_pyrepl/fancy_termios.py index 5b85cb0f5252..0468b9a26702 100644 --- a/Lib/_pyrepl/fancy_termios.py +++ b/Lib/_pyrepl/fancy_termios.py @@ -40,7 +40,9 @@ class TermState: self.lflag, self.ispeed, self.ospeed, - self.cc, + # Always return a copy of the control characters list to ensure + # there are not any additional references to self.cc + self.cc[:], ] def copy(self): diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst new file mode 100644 index 000000000000..8fe628d18f4b --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst @@ -0,0 +1 @@ +Restore terminal control characters on REPL exit.