unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection
@ 2023-02-20 21:27 Dima Kogan
  2023-02-26 14:45 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Dima Kogan @ 2023-02-20 21:27 UTC (permalink / raw)
  To: 61663

Hi. This happens with a bleeding-edge emacs. I'm using a yubikey-based
ssh key, so I need to enter a passphrase and touch the yubikey to unlock
the ssh key. It looks like TRAMP is requiring this interaction even when
it shouldn't.

1. emacs -Q

2. C-x C-f /ssh:server:file

   We open some remote file using TRAMP. This is a new ssh connection,
   so I must enter the passphrase and touch the yubikey.

3. Modify the buffer by typing something into it. Do not save

4. Break the ssh link. One way is to M-x tramp-cleanup-this-connection

5. Try to kill the buffer with C-x k. Emacs says something like "Buffer
   modified. Kill anyway?" I say "yes". I would expect emacs to throw
   away the modified buffer. Instead it tries to re-establish the
   network connection to (presumably) do some cleanup. This requires the
   yubikey auth again. If I don't follow through the passphrase,
   touching prompts by pressing C-g, the modified buffer sticks around,
   and there doesn't appear to be any way to kill it.

With a "normal" ssh key, without a yubikey TRAMP still tries to
re-establish the network connection here. But it quickly fails, and the
(kill-buffer) still succeeds. With a yubikey it fails when I kill it and
the (kill-buffer) fails too. TRAMP shouldn't be trying to re-establish
the connection here probably.

Thanks!





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection
  2023-02-20 21:27 bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection Dima Kogan
@ 2023-02-26 14:45 ` Michael Albinus
  2023-03-19 12:44   ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2023-02-26 14:45 UTC (permalink / raw)
  To: Dima Kogan; +Cc: 61663

Dima Kogan <dima@secretsauce.net> writes:

> Hi.

Hi Dima,

> This happens with a bleeding-edge emacs. I'm using a yubikey-based
> ssh key, so I need to enter a passphrase and touch the yubikey to unlock
> the ssh key. It looks like TRAMP is requiring this interaction even when
> it shouldn't.
>
> 1. emacs -Q
>
> 2. C-x C-f /ssh:server:file
>
>    We open some remote file using TRAMP. This is a new ssh connection,
>    so I must enter the passphrase and touch the yubikey.
>
> 3. Modify the buffer by typing something into it. Do not save
>
> 4. Break the ssh link. One way is to M-x tramp-cleanup-this-connection
>
> 5. Try to kill the buffer with C-x k. Emacs says something like "Buffer
>    modified. Kill anyway?" I say "yes". I would expect emacs to throw
>    away the modified buffer. Instead it tries to re-establish the
>    network connection to (presumably) do some cleanup. This requires the
>    yubikey auth again. If I don't follow through the passphrase,
>    touching prompts by pressing C-g, the modified buffer sticks around,
>    and there doesn't appear to be any way to kill it.
>
> With a "normal" ssh key, without a yubikey TRAMP still tries to
> re-establish the network connection here. But it quickly fails, and the
> (kill-buffer) still succeeds. With a yubikey it fails when I kill it and
> the (kill-buffer) fails too. TRAMP shouldn't be trying to re-establish
> the connection here probably.

When the buffer is modified, kill-buffer tries to unlock the respective
file. I've modified tramp-handle-unlock-file such a way that it ceases
to work when the connection is broken.

Pushed to master. Could you, pls, check?

> Thanks!

Best regards, Michael.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection
  2023-02-26 14:45 ` Michael Albinus
@ 2023-03-19 12:44   ` Michael Albinus
  2023-03-19 20:30     ` Dima Kogan
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2023-03-19 12:44 UTC (permalink / raw)
  To: Dima Kogan; +Cc: 61663-done

Version: 30.1

Michael Albinus <michael.albinus@gmx.de> writes:

Hi Dima,

> When the buffer is modified, kill-buffer tries to unlock the respective
> file. I've modified tramp-handle-unlock-file such a way that it ceases
> to work when the connection is broken.
>
> Pushed to master. Could you, pls, check?

No further response, so I assume the bug is fixed. Closing.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection
  2023-03-19 12:44   ` Michael Albinus
@ 2023-03-19 20:30     ` Dima Kogan
  0 siblings, 0 replies; 4+ messages in thread
From: Dima Kogan @ 2023-03-19 20:30 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 61663

Hi Michael. I forgot to test this; apologies. I did just try out your
fix, and it does work for me. Thanks!





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-19 20:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-20 21:27 bug#61663: 30.0.50; TRAMP: (kill-buffer) sometimes cannot kill modified buffer without re-establishing a connection Dima Kogan
2023-02-26 14:45 ` Michael Albinus
2023-03-19 12:44   ` Michael Albinus
2023-03-19 20:30     ` Dima Kogan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).