GNU bug report logs -
#63629
28.3; Emacsclient exits with no error message and breaks terminal when opening a file without permissions
Previous Next
Reported by: Adam Ibrahim <ibrahimadam193 <at> gmail.com>
Date: Sun, 21 May 2023 18:10:02 UTC
Severity: normal
Found in version 28.3
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 63629 <at> debbugs.gnu.org (full text, mbox):
> From: Adam Ibrahim <ibrahimadam193 <at> 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)
This bug report was last modified 1 year and 357 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.