我想使用nodemon
,但仍然需要使用我的终端,所以我运行了
$ nodemon &> site.log &
但是当我在提示符下输入一个字符时,nodemon 就会停止并显示此消息。
[1] + 45260 suspended (tty input) nodemon &> site.log
发生什么事了?我怎样才能阻止这种情况发生?
我正在 MacOS 上运行 zsh
。
编辑:
我发现this答案完美地解释了它 - 显然 nodemon
尝试从 stdin
读取,unix 系统将停止尝试从 stdin
读取的进程背景。所以我的问题现在变成了:
如何让 nodemon
停止从 stdin
读取?而且,更一般地说,有没有办法让任意进程停止从 stdin
读取?
最佳答案
我明白了。我必须将 /dev/null
重定向到输入。
$ nodemon < /dev/null &> site.log &
关于jobs - nodemon 在后台运行在终端输入时停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55778985/