因此,当我通过 ssh 进入远程服务器时,我使用“screen -R myscreen”来防止任何正在运行的脚本/进程在 ssh 连接断开时被中断,无论出于何种原因(wifi 不好等)。
但是,当启动 screen 时,iTerm2 的 shell 集成不再起作用。
有什么解决方法吗?
最佳答案
仅供引用,我找到的解决方案是:
通过执行 tmux -CC
代替 'screen' 使用 'tmux'打开 tmux session (并使用 tmux -CC attach
在断开连接后重新连接。)
这也描述了 here .
要使 iTerm2 shell 集成在 tmux 中工作,请修改 ~/.iterm2_shell_integration.bash
并删除第一行的这一部分:"$TERM" != screen
所以这if [[ "$TERM" != screen && "$ITERM_SHELL_INTEGRATION_INSTALLED" = "" && "$-" == *i* ]]; then
变成:if [[ "$ITERM_SHELL_INTEGRATION_INSTALLED" = "" && "$-" == *i* ]]; then
关于shell - 使用iTerm2 'shell integration'和screen的解决方案(通过ssh),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40566430/