Is there a way to connect a shell to a pseudo tty?

落花浮王杯 提交于 2020-12-15 04:03:09

问题


If I have a (compiled) background process (on GNU/Linux) such as a daemon create a pseudo-tty for itself, using openpty() or similar, is there a way to connect to it from the shell, for example to open a command line oriented interface (e.g. for debugging / re-configuring it on the fly).

This is very similar to what is asked here:

How to create pty that is connectable by Screen app in Linux

Someone suggests an answer where they connect to it using screen and minicom but it is not that clear to me how. I had assumed screen could only connect to screens created by screen.

Ideally I want to either use standard command line tools to connect to the daemon or provide a lightweight program that does the necessary.

The aim is for something simpler than going for a full scale client server implementation (and to play with ttys).

This is a cut-down version of attach a terminal to a process running as a daemon (to run an ncurses UI) which is a bit more vague.

来源:https://stackoverflow.com/questions/65152924/is-there-a-way-to-connect-a-shell-to-a-pseudo-tty

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