From 9b5f84c7a67bcbdfe5e622c80edba5469b0dd58a Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sun, 29 Dec 2024 14:40:35 +0000 Subject: [PATCH 1/4] gh-128330: Terminal settings are not correctly restored on repl exit --- Lib/_pyrepl/fancy_termios.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/_pyrepl/fancy_termios.py b/Lib/_pyrepl/fancy_termios.py index 5b85cb0f52521f..056437b21f3a76 100644 --- a/Lib/_pyrepl/fancy_termios.py +++ b/Lib/_pyrepl/fancy_termios.py @@ -40,7 +40,7 @@ def as_list(self): self.lflag, self.ispeed, self.ospeed, - self.cc, + self.cc[:], ] def copy(self): From 92f39f0357e03959326a3a10d176c18d0cc534a1 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sun, 29 Dec 2024 15:10:02 +0000 Subject: [PATCH 2/4] Add NEWS item --- .../2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst 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 00000000000000..18bc3989bdaebd --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst @@ -0,0 +1 @@ +Terminal control characters should be restored on repl exit From 35f88f91b30da2956f49686bd2df72e920d55c2b Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sun, 12 Jan 2025 19:01:24 +0000 Subject: [PATCH 3/4] Add comment --- Lib/_pyrepl/fancy_termios.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/_pyrepl/fancy_termios.py b/Lib/_pyrepl/fancy_termios.py index 056437b21f3a76..0468b9a2670267 100644 --- a/Lib/_pyrepl/fancy_termios.py +++ b/Lib/_pyrepl/fancy_termios.py @@ -40,6 +40,8 @@ def as_list(self): self.lflag, self.ispeed, self.ospeed, + # Always return a copy of the control characters list to ensure + # there are not any additional references to self.cc self.cc[:], ] From 8e6e0eabadc7b62bb8d9202c62e969e10656a164 Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Sun, 12 Jan 2025 19:23:50 +0000 Subject: [PATCH 4/4] restore news item --- .../2024-12-29-15-09-21.gh-issue-128330.IaYL7G.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index 18bc3989bdaebd..8fe628d18f4bd4 100644 --- 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 @@ -1 +1 @@ -Terminal control characters should be restored on repl exit +Restore terminal control characters on REPL exit.