在Golang中从单个程序打开多个终端窗口

huangapple go评论91阅读模式
英文:

Open multiple terminal windows from single program in Golang

问题

用例

我正在制作一个使用命令行界面的应用程序。

在一个终端窗口中,应向用户显示非静态信息。

在另一个终端窗口中,应向用户显示日志,并允许用户与其进行交互。

我的想法是,我可以使用通道在每个终端窗口运行的Go协程之间发送信息。

问题

在Golang中是否可以同时打开多个终端窗口?如果不行,是否有其他替代方案?

英文:

Usecase

I am making an app that makes use of a command line interface.

In one terminal window, non-static information should be displayed to the user.

In the other terminal window it should display logs to the user, as well as allowing them to interact with it.

My thinking is that I could then use channels to send information between the go routines that each terminal window runs on.

Question

Is it possible to open more than one terminal window at a time with Golang? If not, are there any alternatives?

答案1

得分: 1

也许你可以编写一个前端界面来显示命令,并通过HTTP API与后端进行通信。

英文:

Maybe you can write a frontend to show the commands and communicate with the backend through HTTP API.

huangapple
  • 本文由 发表于 2023年3月1日 18:46:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75602640.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定