从 Linux Makefile 打开终端
我们可以使用 makefile 或某个 c 文件从现有终端打开一个新的终端选项卡或窗口吗?
如果是的话怎么办?预先感谢您的回复。
PS 我想这样做,因为首先在终端中我想运行服务器文件,然后我想打开新终端并在那里运行客户端文件。
我想从第二个终端继续运行脚本。
Can we open a new terminal tab or window from the existing terminal using a makefile or some c file.
If yes how? Thanks in advance for replying.
P.S. I want to do this because first in the terminal I want to run the server file then I want to open the new terminal and there run the file for the client.
From the second terminal I want to continue running the script.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试运行 xterm(最可用的终端窗口程序)并将该程序作为 shell 参数运行。
为此,必须将 DISPLAY 环境变量设置为可用的值(如果您在本地运行 X windows,则可能是这样 - 如果您是远程连接,则情况会更复杂)。
如果您想尝试一下,可以尝试确定其他可用的终端窗口程序以及用户想要使用的内容,但我知道其中一些程序有不同的方式来指定要运行的“shell”。
You could try running
xterm
(the most available terminal window program) with the program to run as the shell argument.For this to work the DISPLAY environmental variable would have to be set to something usable (which it probably will be if you are running X windows locally -- if you are connecting remotely then it's more complicated).
If you want to get fancy you can try to determine what other terminal window programs are available and what the user would want to use, but I know some of them have a different way of specifying which "shell" to run.