I'm confused by some behavior of my Mac OS X Terminal and my Django manage.py
shell and pdb.
When I start a new terminal, the Standard Input is displayed as I type. However, if there is an error, suddenly Standard Input does not appear on the screen. This error continues until I shut down that terminal window.
The Input is still being captured as I can see the Standard Output.
E.g. in pdb.set_trace()
I can 'l' to display where I'm at in the code. However, the 'l' will not be displayed, just an empty prompt.
This makes it hard to debug because I can't determine what I'm typing in.
What could be going wrong and what can I do to fix it?
Use General preferences in Terminal to change the default window settings and the type of shell that's used when a new window is opened in Terminal. To change these preferences in the Terminal app on your Mac, choose Terminal > Preferences, then click General. Choose the initial window configuration.
The Terminal application is a command-line Interface (or shell). By default, the Terminal in Ubuntu and macOS runs the so-called bash shell, which supports a set of commands and utilities; and has its own programming language for writing shell scripts.
While in screen, type the command Ctrl-a " to see a list of open terminals. Currently, you should only have one terminal open, with the number 0 and a default name of the shell you are using. In my case, this is bash. Press enter to go back to your terminal.
To redirect the output of a command to a file, type the command, specify the > or the >> operator, and then provide the path to a file you want to the output redirected to. For example, the ls command lists the files and folders in the current directory.
Maybe this is because there was an error while running Django. Sometimes it happens that the std input disappears because stty
was used. You can manually hide your input by typing:
$ stty -echo
Now you won't see what you typed. To restore this and solve your problem just type
$ stty echo
This could help.
If you exit pdb you can type reset and standard input echo will return. I'm not sure if you can execute something similar within pdb. It will erase what is currently displayed however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With