-
Notifications
You must be signed in to change notification settings - Fork 124
Closed
Labels
Milestone
Description
(Cmd)
Documented commands (type help <topic>):
========================================
_relative_load help mumble pyscript save shell speak
cmdenvironment history orate quit say shortcuts
edit load py run set show
stty: stdin isn't a terminal
(Cmd) stty: stdin isn't a terminal
Notice how the command is not output by Cmd2, but the prompt is. This means that the output can not be used as a transcript. There are several options to improve the behavior:
- Output the prompt and the command. This makes the output a testable transcript.
- Output neither the prompt or the command. This makes the output easily parseable by other command line utilities that may want to consume only the output. This is the current behavior of the load command, which does a similar thing.
- Make some setting which allows you to choose between option 1 or option 2. Subclasses of Cmd2 could get this setting from a command line switch, or permanently set it one way or the other.
The other problem are the mysterious 'stty: stdin isn't a terminal' messages. A cursory glance at the code in _cmdloop seems to indicate that Cmd2 always expects to read input from a tty. When we run the load command, the commands to run get added to .cmdqueue and nothing is read from stdin.