What does “stty raw -echo” do on OS X

南笙酒味 提交于 2019-11-29 03:05:15

Firstly, the dash means "disable" a setting. So this enables echoing:

stty echo

This disables it:

stty -echo

When you disable it, your typing is not echoed back to you, which is why it seems as if the terminal is hanging. Try stty -echo then type ls and press return - you will still see the output of ls.

The raw setting means that the input and output is not processed, just sent straight through. Processing can be things like ignoring certain characters, translating characters into other characters, allowing interrupt signals etc. So with stty raw you can't hit Ctrl-C to end a process, for example.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!