什么PTY和TTY是什么意思?

什么PTY和TTY是什么意思?

问题描述:

我注意到有很多提到 PTY 的tty 在一些开源项目,可能有人能告诉我是什么做他们的意思和它们之间有什么区别呢?谢谢!

I noticed there are many mentions of pty and tty in some opensource projects, could someone can tell me what do they mean and what is the difference between them? Thanks!

TTY最初的意思是电​​传和PTY是指伪电传。

"tty" originally meant "teletype" and "pty" means "pseudo-teletype".

在UNIX中,/ dev / tty的*是,就像一个电传,也就是说,终端的任何设备。 (称为电传,因为这是我们不得不对那些愚昧的日子终端。)

In UNIX, /dev/tty* is any device that acts like a "teletype", ie, terminal. (Called teletype because that's what we had for terminals in those benighted days.)

一个PTY是pseudotty,那就像一个终端的过程中阅读和写作有一个设备条目,而是由别的东西来管理。它们第一次出现(我记得)为X Window和屏幕之类的,你需要的东西,行事ILKE终端,但可以从另一个程序使用。

A pty is a pseudotty, a device entry that acts like a terminal to the process reading and writing there, but managed by something else. They first appeared (as I recall) for X Windows and screen and the like, where you needed something that acted ilke a terminal but could be used from another program.