暂停在 console2 内运行的 bash 进程
在其他终端中,我会按 Ctrl+z
暂停应用程序,然后通常会发出 bg
将其发送到后台。
在 console2 中,Ctrl+z
不执行任何操作,可能是因为组合键在 Windows 中具有不同的含义。但是除了“process &”之外,有没有办法达到相同的效果呢?
(我知道我应该使用 &
并且它可以工作,但有时我会设置 shell,启动编辑器,开始编辑,然后返回到控制台只是发现我忘记了 &
并且我无法使用 shell,这让我很恼火,然后我必须打开一个新 shell 并再次设置它,或者退出编辑器,使用 &
启动它并重新设置一下)。
In other terminals I would press Ctrl+z
to suspend an application, often to then issue bg
to send it into background.
In console2 Ctrl+z
does nothing, probably because the key combination has a different meaning in Windows. But is there a way to achieve the same effect, save for 'process &'?
(I know I should use &
and it works, but sometimes I would setup shell, start an editor, begin editing, then return to the console just to find that I forgot the &
and I can't use the shell. It annoys me that I then have to either open a new shell and set it up again, or quit the editor, start it with &
and set it up again).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Console2 中,ctrl-c 默认绑定为复制(文本),您必须按 ctrl-shift-c 才能取消作业。
In Console2, ctrl-c is bound by default to copy (text) you have to press ctrl-shift-c to cancel job.
您还可以尝试删除与 ctrl+z 冲突的热键。
我在使用 ctrl+c 取消脚本的执行时遇到问题。当我删除该热键后,
ctrl+c
就恢复了默认值,并且我能够正确取消执行。You could also try to remove the hotkey that is conflicting with
ctrl+z
.I was having trouble using
ctrl+c
to cancel the execution of a script. As soon as I removed that hotkey,ctrl+c
had its default restored and I was able to cancel executions properly.这个恼人的问题肯定是 console2 的错误。您可能会在其问题跟踪器中找到相关信息。
不管怎样,
ctrl+z
所做的就是向当前进程发送一个SIGSTOP
信号。因此,您仍然可以从另一个会话/选项卡发送该信号。 (如果它比使用&
停止并开始更不烦人)。为此,您可以使用
kill
命令。(pid是进程PID号)
希望有帮助。
This annoying issue surely is a console2 bug. You may find something about at its issue tracker.
Anyway, what
ctrl+z
does is send aSIGSTOP
signal to current process. So, you can still send that signal from another session/tab. (If it is less annoying than stop and start with&
).To do that, you can use the
kill
command.(pid is the process PID number)
Hope it helps.