我有一个命令,每次打开新终端或进行新登录时都会运行该命令。
该程序产生的输出(彩色)应位于命令提示符之前。运行可能需要几秒钟,这将阻止我在此之前使用终端(除非在后台运行)。
鉴于 zsh 有一些高级方法可以在不破坏现有文本的情况下重绘终端,我想知道如何以一种无需等待它完成即可使用终端的方式运行此命令,但是完成后,它会打印输出,就好像它最初没有背景一样。
在实践中,我想要一些可以做的事情:
Command output:
... (running on background)
me@computer: somecommand
me@computer: someothercommand
Run Code Online (Sandbox Code Playgroud)
一旦命令完成,我会得到:
Command output:
* Output foo
* Multiple lines bar
* and some yada
me@computer: somecommand
me@computer: someothercommand
Run Code Online (Sandbox Code Playgroud)
我尝试在启动时将进程置于后台,但随后它没有清晰地显示输出。我得到类似的东西:
Command output:
[2] 32207
me@computer: somecommand
me@computer: someother * Output foo
* Multiple lines bar
* and some yada
[2] + done command
me@computer: someothercommand
Run Code Online (Sandbox Code Playgroud)
那么,这可能吗?如果没有 zsh 有什么解决方案可以做到吗?
欢迎任何指点或信息。