tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Refrain from immediate `delete-process` in `tramp-cleanup-all-connec


From: Michael Albinus
Subject: Re: Refrain from immediate `delete-process` in `tramp-cleanup-all-connections`
Date: Sat, 18 Jan 2025 10:10:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Jordan Ellis Coppard <jc+o.emacs@wz.ht> writes:

Hi Jordan,

> So while I am using the podman and podmancp methods, perhaps creating
> my own since I need some heavier customisation on listing containers
> for completion etc that point is moot since Tramp maintains an ssh
> connection for its control on the remote.

Could you pls tell what else you need for completion of container names?
Perhaps we can improve Tramp's machinery.

> Redefining tramp-cleanup-all-connections in my init.el by simply
> copy-pasting it and changing a single line at the end of the function
> from
>
>     (when (processp (get-buffer-process name)) (delete-process name))
>
> to
>
>     (when (processp (get-buffer-process name)) (signal-process name
>     'SIGTERM))
>
> resolves the issue. Now Tramp kills ssh gracefully which correctly
> terminates and closes the remote pty and shell process.

I will try it. However, I have no chance to test seriously other but
GNU/Linux systems (I run Fedora 41), so we must wait for bug reports
afterwards ...

> Additionally signal-process-functions can be used to define functions
> to send signals to processes when signal-process is called, so Tramp
> could first attempt SIGTERM and wait say.. 3 seconds (some
> configurable time) and then attempt another signal etc and finally
> SIGKILL (with a message logged to *Messages* to indicate the dangerous
> SIGKILL'ing of the process).

signal-process-functions is not an option yet. It exists still Emacs 29;
Tramp 2.8 is backward compatible down to Emacs 28.

> I know that's a decent wall of text, I just wanted to give more context.

But thanks. Let's see how it goes.

> /Jordan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]