GNU bug report logs - #42350
26.3; C-c C-c in R console buffer causes Control key to get "stuck"

Previous Next

Package: emacs;

Reported by: Mark Seeto <markseeto <at> gmail.com>

Date: Tue, 14 Jul 2020 04:44:01 UTC

Severity: normal

Found in version 26.3

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 42350 in the body.
You can then email your comments to 42350 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Tue, 14 Jul 2020 04:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark Seeto <markseeto <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 14 Jul 2020 04:44:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark Seeto <markseeto <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; C-c C-c in R console buffer causes Control key to get "stuck"
Date: Tue, 14 Jul 2020 12:26:26 +1000
[Message part 1 (text/plain, inline)]
I'm running R using the ESS package (version 18.10.2, installed using
package-list-packages) in Emacs 26.3 in MS Windows 10.

When I'm in an R console window (Emacs buffer named "*R*" where R is
running) and I press C-c C-c using the right (not left) Control key, Emacs
starts acting as though the Control key is being held down. For example, if
I press C-c C-c <return> in the R console buffer using the right Control
key, I get the message "<C-return> is undefined", and it keeps happening
with further key presses (e.g. pressing p moves to the previous line). The
problem doesn't happen if I press C-c C-c in the R console buffer using the
left Control key. Even other programs (e.g. Notepad, Firefox) start acting
as though Control is being pressed.

The "stuck" Control key can be "released" by pressing the left Control key.

The problem doesn't happen if I press C-c C-c (using either Control key) in
an Emacs buffer with a .R file.

I normally use Vincent Goulet's modified version of Emacs, but the problem
also happens with "ordinary" unmodified Emacs. In the steps below, I'm
using the unmodified Emacs.

Steps to make the problem happen:

At the Windows command prompt, in the Emacs bin directory:
emacs -Q <return>

Type or copy the following into the *scratch* buffer:
(package-initialize)
(setq inferior-R-program-name "C:/Program
Files/R/R-3.6.1/bin/x64/Rterm.exe")

Run the code in the *scratch* buffer:
M-x eval-buffer <return>

Start R:
M-x R <return> <return>

(This opens an R console buffer and takes you to it.)

Using the right Control key:
C-c C-c <return>

This gives the message "<C-return> is undefined", which shouldn't happen
(it doesn't happen if the C-c C-c <return> is pressed using the left
Control key).

Further key presses are treated as though Control is being held down. For
example, pressing p acts like C-p.

Press the left Control key to go back to normal.


Additional information:
- The problem doesn't happen with Emacs 25.3.1 (with the same version of
ESS).
- The problem also happens with the latest version of R (4.0.2).
- The problem also happens if inferior-ess-r-program is used in place of
inferior-R-program-name in the steps above.
- I tried a different keyboard on the same computer, and the same thing
happened. I also tried it on a different Windows 10 computer and the same
thing happened.

Copied from M-x report-emacs-bug:

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29 built on CIRROCUMULUS
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor 'Microsoft Corp.', version 10.0.18363
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
Type C-h m for help on ESS version 18.10.2
ess-tracebug mode enabled
<C-return> is undefined

Configured using:
 'configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS THREADS LCMS2

Important settings:
  value of $LANG: ENA
  locale-coding-system: cp1252

Major mode: iESS

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr
mail-utils cl-extra help-mode ess-r-mode ess-r-flymake flymake-proc
flymake warnings thingatpt ess-r-xref xref project subr-x ess-trns
ess-r-package shell pcomplete ess-r-syntax ess-r-completion ess-roxy
ess-rd essddr noutline outline easy-mmode hideshow ess-s-lang ess-help
ess-mode ess ess-noweb-mode ess-inf ess-tracebug advice format-spec
ess-utils ido ess-custom executable compile comint ansi-color ring
finder-inf ess-generics info package easymenu epg-config url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs cl-lib elec-pair time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads w32notify w32
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 156874 9057)
 (symbols 48 26904 2)
 (miscs 40 73 170)
 (strings 32 50752 1452)
 (string-bytes 1 1386755)
 (vectors 16 22886)
 (vector-slots 8 595421 10002)
 (floats 8 90 266)
 (intervals 56 303 14)
 (buffers 992 16))


Thanks,
Mark Seeto
--
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Tue, 14 Jul 2020 14:50:02 GMT) Full text and rfc822 format available.

Message #8 received at 42350 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mark Seeto <markseeto <at> gmail.com>
Cc: 42350 <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3;
 C-c C-c in R console buffer causes Control key to get "stuck"
Date: Tue, 14 Jul 2020 17:49:23 +0300
> From: Mark Seeto <markseeto <at> gmail.com>
> Date: Tue, 14 Jul 2020 12:26:26 +1000
> 
> I'm running R using the ESS package (version 18.10.2, installed using package-list-packages) in Emacs
> 26.3 in MS Windows 10.
> 
> When I'm in an R console window (Emacs buffer named "*R*" where R is running) and I press C-c C-c
> using the right (not left) Control key, Emacs starts acting as though the Control key is being held down. For
> example, if I press C-c C-c <return> in the R console buffer using the right Control key, I get the message
> "<C-return> is undefined", and it keeps happening with further key presses (e.g. pressing p moves to the
> previous line). The problem doesn't happen if I press C-c C-c in the R console buffer using the left Control
> key. Even other programs (e.g. Notepad, Firefox) start acting as though Control is being pressed.
> 
> The "stuck" Control key can be "released" by pressing the left Control key.

I suspect this is something specific to your Windows system setup,
perhaps in combination with what R does.  Because I tried to reproduce
what you say on a Windows 10 system without R, and couldn't.  It
sounds like some "sticky key" feature or something similar.

I very much doubt this is an Emacs problem.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Wed, 15 Jul 2020 01:41:02 GMT) Full text and rfc822 format available.

Message #11 received at 42350 <at> debbugs.gnu.org (full text, mbox):

From: Mark Seeto <markseeto <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42350 <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3; C-c C-c in R console buffer causes Control key
 to get "stuck"
Date: Wed, 15 Jul 2020 11:39:49 +1000
On Wed, Jul 15, 2020 at 12:49 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> I suspect this is something specific to your Windows system setup,
> perhaps in combination with what R does.  Because I tried to reproduce
> what you say on a Windows 10 system without R, and couldn't.  It
> sounds like some "sticky key" feature or something similar.
>
> I very much doubt this is an Emacs problem.

Thanks for your reply Eli, and thanks for your work on Emacs.

The reason I thought it was an Emacs problem was that the problem
happens consistently in Emacs 26.3 but not in Emacs 25.3.1. But I
don't have a lot of knowledge about Emacs, so there could be something
I'm overlooking.

I wouldn't expect that you could reproduce it on a system without R,
because it only happens (as far as I know) if C-c C-c is pressed with
the right Control key in an R console buffer. It doesn't happen if I
press C-c C-c in a different buffer.

Mark




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Wed, 15 Jul 2020 15:04:01 GMT) Full text and rfc822 format available.

Message #14 received at 42350 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mark Seeto <markseeto <at> gmail.com>
Cc: 42350 <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3; C-c C-c in R console buffer causes Control key
 to get "stuck"
Date: Wed, 15 Jul 2020 18:03:14 +0300
> From: Mark Seeto <markseeto <at> gmail.com>
> Date: Wed, 15 Jul 2020 11:39:49 +1000
> Cc: 42350 <at> debbugs.gnu.org
> 
> The reason I thought it was an Emacs problem was that the problem
> happens consistently in Emacs 26.3 but not in Emacs 25.3.1. But I
> don't have a lot of knowledge about Emacs, so there could be something
> I'm overlooking.

Emacs 26 changed the way it reads keyboard input on MS-Windows, but
this is the first time I hear a complaint about such "sticky"
behavior, so it must be somehow related to R.

> I wouldn't expect that you could reproduce it on a system without R,
> because it only happens (as far as I know) if C-c C-c is pressed with
> the right Control key in an R console buffer. It doesn't happen if I
> press C-c C-c in a different buffer.

Did you try asking on R forums about this problem?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Thu, 16 Jul 2020 06:49:02 GMT) Full text and rfc822 format available.

Message #17 received at 42350 <at> debbugs.gnu.org (full text, mbox):

From: Mark Seeto <markseeto <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42350 <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3; C-c C-c in R console buffer causes Control key
 to get "stuck"
Date: Thu, 16 Jul 2020 16:48:29 +1000
On Thu, Jul 16, 2020 at 1:03 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> Emacs 26 changed the way it reads keyboard input on MS-Windows, but
> this is the first time I hear a complaint about such "sticky"
> behavior, so it must be somehow related to R.
>
> Did you try asking on R forums about this problem?

Thanks for your reply.

I haven't asked on R forums but I asked on the Emacs Speaks Statistics
help mailing list because my first thought was that the problem was
probably caused by a change in a recent version of the ESS package.
After I sent an update with some results suggesting that it wasn't
caused by a change in ESS, someone replied to me saying that he had
the same problem, and he suggested that I send an Emacs bug report.

I've turned off all the Windows "sticky keys" and similar options I
could find (they were already turned off).

I just tried C-c C-c in a Python (Jupyter) console buffer (elpy
package), and the same problem happened in Emacs 26.3 but not in Emacs
25.2.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Thu, 16 Jul 2020 08:31:02 GMT) Full text and rfc822 format available.

Message #20 received at 42350 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mark Seeto <markseeto <at> gmail.com>
Cc: 42350 <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3;
 C-c C-c in R console buffer causes Control key to get "stuck"
Date: Thu, 16 Jul 2020 11:30:32 +0300
On July 16, 2020 9:48:29 AM GMT+03:00, Mark Seeto <markseeto <at> gmail.com> wrote:
> 
> I just tried C-c C-c in a Python (Jupyter) console buffer (elpy
> package), and the same problem happened in Emacs 26.3 but not in Emacs
> 25.2.

Can you please send detailed instructions for how to reproduce this with Python?  I have Python installed, but I don't use it interactively, so I will need detailed step by step instructions.  Including, if needed, installation of add ons.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Thu, 16 Jul 2020 09:46:02 GMT) Full text and rfc822 format available.

Message #23 received at 42350 <at> debbugs.gnu.org (full text, mbox):

From: Mark Seeto <markseeto <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42350 <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3; C-c C-c in R console buffer causes Control key
 to get "stuck"
Date: Thu, 16 Jul 2020 19:45:23 +1000
On Thu, Jul 16, 2020 at 6:30 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> Can you please send detailed instructions for how to reproduce this with Python?  I have Python installed, but I don't use it interactively, so I will need detailed step by step instructions.  Including, if needed, installation of add ons.

For this to work I think you need to have your Python directory in
your Windows path. I have the elpy package installed but as far as I
know, the instructions below don't depend on it.

At the Windows command prompt in the Emacs 26.3 bin directory:
emacs -Q <return>

Start Python:
M-x run-python <return>

Go to the Python console buffer:
C-x o

Using the right Control key:
C-c C-c <return>

For me, this produces the message "<C-return> is undefined", which
doesn't happen if the C-c C-c <return> is entered using the left
Control key. If further keys are pressed, the result is as though a
Control key is being held down.

Press the left Control key to go back to normal.

In Emacs 25.3.1, M-x run-python produces a warning, but once I go to
the Python console buffer, the problem described above doesn't happen.

Thanks.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 16 Jul 2020 16:54:02 GMT) Full text and rfc822 format available.

Notification sent to Mark Seeto <markseeto <at> gmail.com>:
bug acknowledged by developer. (Thu, 16 Jul 2020 16:54:02 GMT) Full text and rfc822 format available.

Message #28 received at 42350-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mark Seeto <markseeto <at> gmail.com>
Cc: 42350-done <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3; C-c C-c in R console buffer causes Control key
 to get "stuck"
Date: Thu, 16 Jul 2020 19:53:03 +0300
> From: Mark Seeto <markseeto <at> gmail.com>
> Date: Thu, 16 Jul 2020 19:45:23 +1000
> Cc: 42350 <at> debbugs.gnu.org
> 
> Start Python:
> M-x run-python <return>
> 
> Go to the Python console buffer:
> C-x o
> 
> Using the right Control key:
> C-c C-c <return>

Thanks.  It turned out you don't need Python or R to reproduce this:
any process run via comint.el will cause the same problem, for example
"M-x gdb".  The problem was in how we restored the status of the Ctrl
key after interrupting a subprocess; I've now fixed that on the
emacs-27 branch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42350; Package emacs. (Thu, 16 Jul 2020 19:42:01 GMT) Full text and rfc822 format available.

Message #31 received at 42350-done <at> debbugs.gnu.org (full text, mbox):

From: Mark Seeto <markseeto <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 42350-done <at> debbugs.gnu.org
Subject: Re: bug#42350: 26.3; C-c C-c in R console buffer causes Control key
 to get "stuck"
Date: Fri, 17 Jul 2020 05:41:30 +1000
On Fri, Jul 17, 2020 at 2:53 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> Thanks.  It turned out you don't need Python or R to reproduce this:
> any process run via comint.el will cause the same problem, for example
> "M-x gdb".  The problem was in how we restored the status of the Ctrl
> key after interrupting a subprocess; I've now fixed that on the
> emacs-27 branch.

Thanks Eli.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 14 Aug 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.