]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable echo back instead of setting tty to raw in Inferior Python
authorkobarity <kobarity@gmail.com>
Thu, 20 Mar 2025 10:03:33 +0000 (19:03 +0900)
committerEshel Yaron <me@eshelyaron.com>
Fri, 18 Apr 2025 06:46:48 +0000 (08:46 +0200)
* lisp/progmodes/python.el (python-shell-setup-code): Change the
Python setup code.  (Bug#76943)

(cherry picked from commit 4c5c20ddc2cdde570ccf54c4aa60644828ee213d)

lisp/progmodes/python.el

index 5ac17896b44b41dc1a8b8967bd44533b003ac901..3746ce3803fe94763af7897d06defa9fef9dbf5a 100644 (file)
@@ -3558,11 +3558,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