[PYTHON] How to fix when Terminal input becomes abnormal

Use scene

The terminal input may be abnormal on UNIX-based OS.

--The entered characters are not displayed --No line breaks on return input

In my experience, I get into this state after interactively running and exiting the version of the python interpreter installed on MacOS X with macports. The solution is to start a new terminal, but there is a slightly easier way to fix it.

How to fix

Run the following command:

$ stty sane

Description

This seems to happen if the running application changes the special characters in terminal and is not restored to its original settings when the application is closed. stty is a command to display or change the terminal settings, and the sane option has the effect of making special characters the default settings.

reference

OS-X terminal behaves oddly after running Python interactively

Recommended Posts

How to fix when Terminal input becomes abnormal
How to exit when using Python in Terminal (Mac)
How to hack a terminal
[Python] How to use input ()
[Go language] How to get terminal input in real time
How to add sudo when debugging
How to get IP when Tornado + nginx
How to start Python (Flask) when EC2 starts
How to deal with errors when hitting pip ②
[Django] How to resolve errors when installing mysqlclient
How to deal with SessionNotCreatedException when using Selenium
How to remember when you forget a word
How to measure line speed from the terminal
How to add Anaconda Powershell Prompt to Windows Terminal?
How to create a Kivy 1-line input box
How to hide user input in PySimple GUI
Memo of how to use properly when combining pandas.DataFrame
How to disable the reference feature when outputting PyYaml
How to access with cache when reading_json in pandas
How to instantly launch Jupyter Notebook from the terminal
How to right click using keyboard input in RPA?
Where to fix code when using plotly for free
How to write faster when using numpy like deque
How to deal with the terminal getting into the pipenv environment without permission when using pipenv with vscode
How to delete "(base)" that appears in the terminal when Anaconda is installed on Mac