我不想等待缓慢的命令完成,而是想在后台运行它们。但是,当它们完成运行并打印到标准输出时,我得到(其中\xe2\x96\x88代表我的光标):
$ slowcmd &\n$ cmd_output\n\xe2\x96\x88\nRun Code Online (Sandbox Code Playgroud)\n\nslowcmd可以是任何慢速命令(对于我尝试过的东西,我只是说alias slowcmd=\'sleep 1 && echo cmd_output\')而我想要这样的东西:
\n\n$ slowcmd && redrawPromptString &\n$ cmd_output\n$ \xe2\x96\x88\nRun Code Online (Sandbox Code Playgroud)\n\n在命令输出之后,会为我打印出一个新的提示字符串。
\n\n我可以做些什么来实现redrawPromptString我想要的?我尝试过clear,kill $$将 a 发送^C到终端,最后printf "^C"(当然这不起作用)。我正在运行 bash。(GNU bash,版本 3.2.57)。