◐ Shell
clean mode source ↗

Message 133740 - Python tracker

hi guys,

this makes Cmd a bit more useful.

my use case is talking to pdb via pipe
(ie. subprocess module).  pdb doesn't 
behave very well if stdin is not a tty.


===================================================================
--- cmdpy.orig/cmd.py   2011-04-14 23:55:01.102867999 +1000
+++ cmdpy/cmd.py        2011-04-14 23:55:16.272868002 +1000
@@ -92,6 +92,8 @@
             self.stdin = stdin
         else:
             self.stdin = sys.stdin
+        if not stdin.isatty():
+            self.use_rawinput = 0
         if stdout is not None:
             self.stdout = stdout