Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Standard Input is not displayed as I type in Mac OS X Terminal application?

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?

like image 326
BryanWheelock Avatar asked Aug 19 '09 18:08

BryanWheelock


People also ask

How do I change Mac Terminal settings?

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.

What Terminal language does Mac use?

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.

How do I use Terminal screen on Mac?

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.

How do I redirect in Mac 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.


2 Answers

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.

like image 188
cb0 Avatar answered Sep 27 '22 23:09

cb0


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.

like image 40
mtnpaul Avatar answered Sep 28 '22 00:09

mtnpaul