Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-128330: Terminal control characters should be restored on repl exit #128331

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Lib/_pyrepl/fancy_termios.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def as_list(self):
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[:],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Let's add a comment explaining why this is here for future readers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added one. Please let me know if you have suggestions for better wording.

]

def copy(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Restore terminal control characters on REPL exit.
Loading