2015-09-28 57 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

相關問題