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)

(cherry picked from commit 4c5c20ddc2)
This commit is contained in:
kobarity 2025-03-20 19:03:33 +09:00 committed by Mattias Engdegård
parent 01d4eb3dd4
commit 4dcd66abd5

View file

@ -3528,11 +3528,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