From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63629: Fwd: bug#63629: 28.3; Emacsclient exits with no error message and breaks terminal when opening a file without permissions Date: Mon, 22 May 2023 16:31:03 +0300 Message-ID: <83v8gkpk6g.fsf@gnu.org> References: <83a5xxr1db.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32822"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63629@debbugs.gnu.org To: Adam Ibrahim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 22 15:31:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q15d9-0008Pf-0c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 May 2023 15:31:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q15cu-0003PN-Sd; Mon, 22 May 2023 09:31:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q15ct-0003Ot-1m for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 09:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q15cs-0002YF-Q4 for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 09:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q15cs-0000e8-6X for bug-gnu-emacs@gnu.org; Mon, 22 May 2023 09:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 May 2023 13:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63629 X-GNU-PR-Package: emacs Original-Received: via spool by 63629-submit@debbugs.gnu.org id=B63629.16847622542469 (code B ref 63629); Mon, 22 May 2023 13:31:02 +0000 Original-Received: (at 63629) by debbugs.gnu.org; 22 May 2023 13:30:54 +0000 Original-Received: from localhost ([127.0.0.1]:34078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q15cj-0000dj-O2 for submit@debbugs.gnu.org; Mon, 22 May 2023 09:30:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q15cg-0000dT-HQ for 63629@debbugs.gnu.org; Mon, 22 May 2023 09:30:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q15cb-0002Wi-52; Mon, 22 May 2023 09:30:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3Q8garFM3sZaw0+rPdg0SO59pjd7YUsy9VmbZWEYM68=; b=P6APp08mR28j PO4g5ZpRtpFA+s8lEKB4tm1FZWWlZcOhlLQZZeBjj722uI1QXdtQBmxJ3XOwSHf60qlFqGVRohLUt eViW64ih/BgSRQfHViQYll0GjhFs145z4dxFW0oXOIoz8Hzr1SouugDszJiIQ6AWAgC/doGkeV2Y3 6fAkmWLmUPLUgxSSP4xWbOosBYtu4YUyVSZn+lC3mMIcIDox/BuvNZgtfO5z2hYF7RJ+hXGPGlEpq tq+N0uX2QwOKqjkFFQeZ0YvKZEbUVzW2za3qp2rRNm9PIVfvxXSwl1wO5rI/RLzFOjyaJZqhHYa9X 9c+d/H959Ehm9GFrEq00WA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q15cY-0008C8-LO; Mon, 22 May 2023 09:30:44 -0400 In-Reply-To: (message from Adam Ibrahim on Sun, 21 May 2023 14:57:03 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262153 Archived-At: > From: Adam Ibrahim > 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)