From 4c5c20ddc2cdde570ccf54c4aa60644828ee213d Mon Sep 17 00:00:00 2001 From: kobarity Date: Thu, 20 Mar 2025 19:03:33 +0900 Subject: [PATCH] Disable echo back instead of setting tty to raw in Inferior Python * lisp/progmodes/python.el (python-shell-setup-code): Change the Python setup code. (Bug#76943) --- lisp/progmodes/python.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 6fbabe99cb0..32035773fde 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3564,11 +3564,13 @@ eventually provide a shell." (defconst python-shell-setup-code "\ try: - import tty + import termios except ImportError: pass else: - tty.setraw(0)" + attr = termios.tcgetattr(0) + attr[3] &= ~termios.ECHO + termios.tcsetattr(0, termios.TCSADRAIN, attr)" "Code used to setup the inferior Python processes.") (defconst python-shell-eval-setup-code