Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b15d9c

Browse files
authored
gh-128330: Terminal control characters should be restored on repl exit (#128331)
1 parent ec91e1c commit 0b15d9c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/_pyrepl/fancy_termios.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def as_list(self):
4040
self.lflag,
4141
self.ispeed,
4242
self.ospeed,
43-
self.cc,
43+
# Always return a copy of the control characters list to ensure
44+
# there are not any additional references to self.cc
45+
self.cc[:],
4446
]
4547

4648
def copy(self):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restore terminal control characters on REPL exit.

0 commit comments

Comments
 (0)