无法在Tmux中使用活动的IPython/Matplotlib正确退出SSH会话
我遇到了一个问题,即尝试在导入matplotlib的情况下分离远程活动IPython会话(通过Tmux),然后注销SSH挂起。我必须使用Crtl-C来终止进程。当我SSH回到机器中时,tmux进程就消失了 示例IPython:无法在Tmux中使用活动的IPython/Matplotlib正确退出SSH会话,matplotlib,ssh,ipython,tmux,Matplotlib,Ssh,Ipython,Tmux,我遇到了一个问题,即尝试在导入matplotlib的情况下分离远程活动IPython会话(通过Tmux),然后注销SSH挂起。我必须使用Crtl-C来终止进程。当我SSH回到机器中时,tmux进程就消失了 示例IPython: ~$ ssh-desk # ssh into remote machine ~$ tmux ~$ ipython In [1]: import matplotlib.pyplot as plt Crtl-b Crtl-b d [detached (from session
~$ ssh-desk # ssh into remote machine
~$ tmux
~$ ipython
In [1]: import matplotlib.pyplot as plt
Crtl-b Crtl-b d
[detached (from session 0)]
~$ tmux ls
0: 1 windows (created Wed May 2 16:52:58 2018) [78x38]
~$ exit
logout
(process hangs here)
Ctrl-c
~$ ssh-desk
~$ tmux ls
no server running on /tmp/tmux-1000/default
有一次,我确实收到一个关于X11会话被终止的错误。我认为这是因为我使用ssh-Y将X11转发给图形
The X11 connection broke (error 1). Did the X11 server die?
有没有办法在IPython/Python中运行matplotlib并成功分离tmux会话和注销
我使用的是LinuxMint18.3(本地和远程机器),iPython6.3.1
更新
我用谷歌搜索了所有可能的解决方案来分离带有X11转发的tmux会话,但都无法使其工作,包括在.bashrc文件中添加一些显示代码。我还尝试使用xpra,但出现了一个错误,即找不到模块rencode。您可以随时返回ssh转义序列:
sequence | description
-------- | -----------
~. | terminate connection (and any multiplexed sessions)
~B | send a BREAK to the remote system
~C | open a command line
~R | request rekey
~V/v | decrease/increase verbosity (LogLevel)
~^Z | suspend ssh
~# | list forwarded connections
~& | background ssh (when waiting for connections to terminate)
~? | this message
~~ | send the escape character by typing it twice
进入tmux
后,如果您只想终止ssh连接,请键入例如:
~.
然后,您可以再次使用ssh连接到服务器并执行以下操作:
tmux attach
目前为止,这不起作用,因为它会终止X11连接,导致“与本地主机的X连接:11.0断开(显式终止或服务器关闭)”