Subject: bug#70901: 30.0.50; Tramp doesn't use ControlMaster even with (setq tramp-use-connection-share nil)

From: Dmitry Gutov <[email-masked]>
Date: Mon, 13 May 2024 14:56:29 +0300

Hi Michael!

On 13/05/2024 09:07, Michael Albinus wrote:
>> But I haven't been able to make Tramp reuse the connection.
>>
>> I (setq tramp-use-connection-share nil) - so it would pick up the user
>> settings from my ssh config - and the first 'C-x C-f /ssh:user@host:'
>> takes a lot of time anyway with its "Opening connection ...".
> 
> Are you sure you have a recent Tramp? Perhaps you use Tramp from GNU
> ELPA?

I'm using Tramp from the latest Emacs master.

> tramp-use-connection-share can have three different values, t, nil or
> `suppress'. And in case it is nil, nothing wrt ControlMaster will be
> added to the ssh call.

That was the expectation. I experimented with setting ControlMaster 
settings through tramp-ssh-controlmaster-options as well - to the same 
effect - but we should probably concentrate on just one scenario in this 
report.

> Could you pls set tramp-verbose to 6, rerun your test, and show the
> Tramp debug buffer?

Attached, one scenario in an 'emacs -Q' session. 
tramp-use-connection-share and tramp-verbose are the only two settings 
there.

Hope there's nothing sensitive in here (it's a GNU server).

>> On a related note, are asynchronous processes supposed to use
>> ControlMaster when it's available? I get "Opening connection ..." for
>> every M-& call, for example.
> 
> Yes, it should do the same wrt ControlMaster.

Very good.