unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Adam Ibrahim <ibrahimadam193@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 63629@debbugs.gnu.org
Subject: bug#63629: Fwd: bug#63629: 28.3; Emacsclient exits with no error message and breaks terminal when opening a file without permissions
Date: Tue, 23 May 2023 16:30:14 -0400	[thread overview]
Message-ID: <CAHdC_iKFZ0vgEoeJ00h0bEeFWFc7CuHQ7ZAGcY1q8ewq7ENSpg@mail.gmail.com> (raw)
In-Reply-To: <83v8gkpk6g.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 3431 bytes --]

I ran the following commands on my phone in termux and in Kitty on my PC 10
times each and record the results. I did it multiple times because the
results seem random.

 ./src/emacs --fg-daemon -Q
 ./lib-src/emacsclient path/to/no-perms # in a separate terminal, 10 times

Phone + Termux: 9 out of 10 times, I got the expected results where the
terminal was not broken and I saw an error message. on the 10th time there
was some weird behavior, but I haven't been able to reproduce it and I
don't remember what happened.

PC + Kitty: there were no crashes meaning the terminal wasn't broken
anymore. but 6 out of 10 times the error message didn't print. sometimes
all I saw was "waiting for emacs..." and some other times all I saw was
"...". the other four times was expected behavior colon the error message
printed and the terminal wasn't broken.

Note: I have a slightly different environment on my phone compared to the
first time. when I first reported the bug I was using the emacs and
emacsclient programs located on my phone. this time I used the modified
emacs and emacsclient from my desktop over SSH. I don't know if that
changed the results. But the bug with unmodified emacs happens just the
same over SSH as with emacs on my phone.

On Mon, May 22, 2023, 09:30 Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Adam Ibrahim <ibrahimadam193@gmail.com>
> > Date: Sun, 21 May 2023 14:57:03 -0400
> >
> > output of `ls -l`:
> >
> >  ls -l no-perms
> >  ---------- 1 u0_a331 u0_a331 0 May 21 14:27 no-perms
> >
> > commands used:
> >
> >  emacs --fg-daemon -Q
> >  emacsclient no-perms # in a separate terminal
> >
> > what stops working: when I type, the letters I type don't appear in the
> terminal anymore. nothing is
> > echoed back to me. stuff still happens, and I can enter commands, but I
> can't see anything. And the
> > terminal width seems screwed up. like things that should get indented,
> they don't look right.
>
> Thanks.  Please try the patch below and see if it solves the problem
> without adding any new ones.
>
> diff --git a/lisp/server.el b/lisp/server.el
> index eaf24a770e4..7e35eaa6176 100644
> --- a/lisp/server.el
> +++ b/lisp/server.el
> @@ -1138,6 +1138,11 @@ server-process-filter
>        (server-log "Authentication failed" proc)
>        (server-send-string
>         proc (concat "-error " (server-quote-arg "Authentication failed")))
> +      (unless (eq system-type 'windows-nt)
> +        (let ((terminal (process-get proc 'terminal)))
> +          ;; Only delete the terminal if it is non-nil.
> +          (when (and terminal (eq (terminal-live-p terminal) t))
> +           (delete-terminal terminal))))
>        ;; Before calling `delete-process', give emacsclient time to
>        ;; receive the error string and shut down on its own.
>        (sit-for 1)
> @@ -1459,6 +1464,11 @@ server-return-error
>       proc (concat "-error " (server-quote-arg
>                               (error-message-string err))))
>      (server-log (error-message-string err) proc)
> +    (unless (eq system-type 'windows-nt)
> +      (let ((terminal (process-get proc 'terminal)))
> +        ;; Only delete the terminal if it is non-nil.
> +        (when (and terminal (eq (terminal-live-p terminal) t))
> +         (delete-terminal terminal))))
>      ;; Before calling `delete-process', give emacsclient time to
>      ;; receive the error string and shut down on its own.
>      (sit-for 5)
>

[-- Attachment #2: Type: text/html, Size: 4388 bytes --]

  reply	other threads:[~2023-05-23 20:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 18:08 bug#63629: 28.3; Emacsclient exits with no error message and breaks terminal when opening a file without permissions Adam Ibrahim
2023-05-21 18:22 ` Eli Zaretskii
     [not found]   ` <CAHdC_iKdG9viw__B0j9Pqa4Wq9QMpLk5SSc12Ead_SSGfAFJhw@mail.gmail.com>
2023-05-21 18:57     ` bug#63629: Fwd: " Adam Ibrahim
2023-05-22 13:31       ` Eli Zaretskii
2023-05-23 20:30         ` Adam Ibrahim [this message]
2023-05-24 10:52           ` Eli Zaretskii
2023-05-24 12:08             ` Adam Ibrahim
2023-05-26 10:29               ` Eli Zaretskii
2023-05-31 13:20                 ` Eli Zaretskii
2023-05-21 19:05     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHdC_iKFZ0vgEoeJ00h0bEeFWFc7CuHQ7ZAGcY1q8ewq7ENSpg@mail.gmail.com \
    --to=ibrahimadam193@gmail.com \
    --cc=63629@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).