magit似乎为每个命令打开了一个新的ssh连接。这变得非常烦人,特别是当分阶段放置更多块时,这需要为每个块建立连接的时间非常明显。
(在shell中,我通过./ ssh /config启用了持久的ssh连接)
我不知道这是魔术还是流浪汉。
但我的问题是:
如何使magit重新使用ssh连接?
编辑:
客户是
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
(setq tramp-default-method "ssh")
(setq tramp-inline-compress-start-size 1000000) ## generally re-use existing connections
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
Host myhost1
HostName 111.11.11.1
User myuser
ForwardX11 yes
ForwardX11Timeout 596h
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
ForwardAgent yes
SendEnv LC_*
ServerAliveInterval 300服务器为RHEL 7.6 (Maipo)
发布于 2020-01-17 10:19:21
默认情况下,Tramp不使用在SSH配置文件( ControlMaster )中定义的见流浪汉常见问题选项:
在启动ssh会话时,Tramp覆盖ControlPath设置。如果在Emacs会话之外打开的主会话不再打开,则Tramp这样做是为了抵挡失速。
FAQ还展示了如何为TRAMP配置ControlMaster选项:
(customize-set-variable
'tramp-ssh-controlmaster-options
(concat
"-o ControlPath=/tmp/ssh-ControlPath-%%r@%%h:%%p "
"-o ControlMaster=auto -o ControlPersist=yes"))或者,如果要告诉Tramp使用~/.ssh/config文件中的自定义,则需要更改tramp-use-ssh-controlmaster-options变量:
(customize-set-variable 'tramp-use-ssh-controlmaster-options nil)https://stackoverflow.com/questions/56105716
复制相似问题