2015-09-28 173 views
0

在TMUX,如果我在vim创建tmux new-window vim一个新的窗口,然后我启动一个进程(如:!scite &),然后我退出vim(例如用:q),这也将关闭TMUX窗口,启动的过程(scite)也被杀害。我怎样才能防止这一点?如何防止当窗口关闭时tmux窗口启动的进程被终止?

请注意,如果我使用tmux new-window先创建一个新的shell窗口,然后手动启动vim,然后执行其他操作,并退出shell,则该进程不会终止。

+0

你为什么需要从vim启动一个后端进程。特别是对于你的例子'scite'?你的意思是编辑人员? – Kent

+0

是的,'scite'是一个文本编辑器。例如,我使用':!scite%&'从'vim'编辑某个文件。 – aggu

回答

0

启动通过setsid代替(例如:!setsid scite &)。

1

你在找什么是tmux的remain-on-exit选项。

new-window命令:

当外壳命令完成后,窗口关闭。请参阅 保持退出选项以更改此行为。

set-remain-on-exit DOC:

set-remain-on-exit [on | off] 
        Set the remain-on-exit window option for any windows first created in this session. When this option is true, windows in which the running pro‐ 
        gram has exited do not close, instead remaining open but inactivate. Use the respawn-window command to reactivate such a window, or the 
        kill-window command to destroy it. 
+0

是的。但我不想要死的窗户。还有其他解决方案吗? – aggu

+0

为了确保,我只是尝试方法('tmux set set-remain-on-exit on'),但发现它不起作用,启动的进程仍然被终止。 – aggu