GNU bug report logs -
#64121
28.2; C-SPC not working in term char mode
Previous Next
Reported by: Al Petrofsky <al <at> petrofsky.org>
Date: Sat, 17 Jun 2023 00:08:02 UTC
Severity: normal
Found in version 28.2
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64121 in the body.
You can then email your comments to 64121 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64121
; Package
emacs
.
(Sat, 17 Jun 2023 00:08:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Al Petrofsky <al <at> petrofsky.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 17 Jun 2023 00:08:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
emacs-28.2 -Q
M-x term RET RET
C-SPC
This should send an ASCII NUL (a zero byte) to the pty, but instead it
displays "Mark set" in the echo area.
To fix it, C-SPC needs to get special handling akin to the handling of
C-/. Here's a patch that also makes C-M-SPC and C-M-/ work.
--- term.el 2022-09-06 17:31:54.000000000 -0400
+++ term-c-spc-fixed.el 2023-06-15 11:21:41.780140053 -0400
@@ -916,6 +916,9 @@
(define-key map [next] 'term-send-next)
(define-key map [xterm-paste] #'term--xterm-paste)
(define-key map [?\C-/] #'term-send-C-_)
+ (define-key map [?\C- ] #'term-send-C-@)
+ (define-key map [?\C-\M-/] #'term-send-C-M-_)
+ (define-key map [?\C-\M- ] #'term-send-C-M-@)
map)
"Keyboard map for sending characters directly to the inferior process.")
@@ -1359,6 +1362,9 @@
(defun term-send-del () (interactive) (term-send-raw-string "\e[3~"))
(defun term-send-backspace () (interactive) (term-send-raw-string "\C-?"))
(defun term-send-C-_ () (interactive) (term-send-raw-string "\C-_"))
+(defun term-send-C-@ () (interactive) (term-send-raw-string "\C-@"))
+(defun term-send-C-M-_ () (interactive) (term-send-raw-string "\e\C-_"))
+(defun term-send-C-M-@ () (interactive) (term-send-raw-string "\e\C-@"))
(defun term-char-mode ()
"Switch to char (\"raw\") sub-mode of term mode.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64121
; Package
emacs
.
(Sat, 17 Jun 2023 06:13:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 64121 <at> debbugs.gnu.org (full text, mbox):
> From: Al Petrofsky <al <at> petrofsky.org>
> Date: Fri, 16 Jun 2023 20:06:57 -0400
>
> emacs-28.2 -Q
> M-x term RET RET
> C-SPC
>
> This should send an ASCII NUL (a zero byte) to the pty, but instead it
> displays "Mark set" in the echo area.
I cannot reproduce this here: I don't see "Mark set" in the echo area.
Maybe this somehow depends on the terminal emulator? (I use PuTTY.)
How to verify that the null character is sent to the pty?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64121
; Package
emacs
.
(Sat, 17 Jun 2023 06:27:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 64121 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sat, Jun 17, 2023 at 2:12 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > From: Al Petrofsky <al <at> petrofsky.org>
> > Date: Fri, 16 Jun 2023 20:06:57 -0400
> >
> > emacs-28.2 -Q
> > M-x term RET RET
> > C-SPC
> >
> > This should send an ASCII NUL (a zero byte) to the pty, but instead it
> > displays "Mark set" in the echo area.
>
> I cannot reproduce this here: I don't see "Mark set" in the echo area.
>
> Maybe this somehow depends on the terminal emulator? (I use PuTTY.)
>
I should have mentioned this bug won't show up if emacs is running in a
tty. The bug
stems from the subtle difference between C-SPC and C-@ input events on
graphical
terminals. On a tty, C-SPC and C-@ become the same thing before they get
to emacs.
> How to verify that the null character is sent to the pty?
>
You can start an emacs -nw inside the term. Then pressing C-SPC should
result in a "Mark set" in the inner emacs's echo area.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64121
; Package
emacs
.
(Sat, 17 Jun 2023 06:41:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 64121 <at> debbugs.gnu.org (full text, mbox):
> From: Al Petrofsky <al <at> petrofsky.org>
> Date: Sat, 17 Jun 2023 02:26:40 -0400
> Cc: 64121 <at> debbugs.gnu.org
>
> On Sat, Jun 17, 2023 at 2:12 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: Al Petrofsky <al <at> petrofsky.org>
> > Date: Fri, 16 Jun 2023 20:06:57 -0400
> >
> > emacs-28.2 -Q
> > M-x term RET RET
> > C-SPC
> >
> > This should send an ASCII NUL (a zero byte) to the pty, but instead it
> > displays "Mark set" in the echo area.
>
> I cannot reproduce this here: I don't see "Mark set" in the echo area.
>
> Maybe this somehow depends on the terminal emulator? (I use PuTTY.)
>
> I should have mentioned this bug won't show up if emacs is running in a tty. The bug
> stems from the subtle difference between C-SPC and C-@ input events on graphical
> terminals. On a tty, C-SPC and C-@ become the same thing before they get to emacs.
Then I'm afraid I cannot evaluate this bug and its proposed solution,
as I don't have access to a platform where I can run a GUI Emacs with
"M-x term" still supported.
Could someone else please reproduce this and review the proposed
changes? TIA.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#64121
; Package
emacs
.
(Sat, 17 Jun 2023 07:09:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 64121 <at> debbugs.gnu.org (full text, mbox):
>
> Could someone else please reproduce this and review the proposed
> changes? TIA.
>
I can reproduce this (with Emacs 29), and the proposed changes LGTM.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sun, 18 Jun 2023 06:36:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Al Petrofsky <al <at> petrofsky.org>
:
bug acknowledged by developer.
(Sun, 18 Jun 2023 06:36:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 64121-done <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 17 Jun 2023 07:08:25 +0000
> From: Gregory Heytings <gregory <at> heytings.org>
> cc: Al Petrofsky <al <at> petrofsky.org>, 64121 <at> debbugs.gnu.org
>
> > Could someone else please reproduce this and review the proposed
> > changes? TIA.
>
> I can reproduce this (with Emacs 29), and the proposed changes LGTM.
Thanks, installed on the master branch, and closing the bug.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 16 Jul 2023 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 343 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.