unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / Atom feed
* bug#45834: 28.0.50; Mouse events in terminal emacs
@ 2021-01-12 23:29 Brady
  2021-01-19  6:38 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Brady @ 2021-01-12 23:29 UTC (permalink / raw)
  To: 45834

Tested with emacs -Q -nw, in Terminal.app, with TERM=xterm-256color. The issue does not reproduce with TERM=rxvt.

If I press "C-h k", and then switch to another application, then this is registered as "ESC [ I-", and then upon switching back, as "ESC [ O-". I think this is about mouse events, in and out, or "I" and "O".

I think since I actually have M-[ bound to resize windows (without -Q), then this allows I and O to be passed to emacs and inserted as text, or for more strange behavior in other modes like evil or magit.

I'm not sure if this is considered an emacs problem, or if there is an idea for a workaround, besides perhaps unbinding M-[.

I just tested in a debian VM as well, with snapd's emacs 27.1, and the same issue occurs, C-h k, then M-TAB to switch to other application shows ESC [ I- in minibuffer. Similarly issue is seen with TERM=xterm-256color but not with rxvt.

Thank you,
-Brady

In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H2))
 of 2020-10-25 built on clay.local
Repository revision: 10ea719abcde4f2ee40e717eb846fe93f51d5d79
Repository branch: master
System Description:  Mac OS X 10.15.7

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS PDUMPER

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  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
  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 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x 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 shortdoc seq help-fns radix-tree
help-mode easymenu cl-loaddefs cl-lib term/xterm xterm byte-opt gv
bytecomp byte-compile cconv tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize
mule-util 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 tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer 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 cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 61436 5322)
 (symbols 48 6973 1)
 (strings 32 19556 966)
 (string-bytes 1 625828)
 (vectors 16 9903)
 (vector-slots 8 124271 9350)
 (floats 8 95 309)
 (intervals 56 351 0)
 (buffers 992 12))





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45834: 28.0.50; Mouse events in terminal emacs
  2021-01-12 23:29 bug#45834: 28.0.50; Mouse events in terminal emacs Brady
@ 2021-01-19  6:38 ` Lars Ingebrigtsen
  2021-01-19  8:24   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-19  6:38 UTC (permalink / raw)
  To: 45834

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

Brady <bug-gnu-emacs_at_gnu.org@tangential.info> writes:

> I just tested in a debian VM as well, with snapd's emacs 27.1, and the
> same issue occurs, C-h k, then M-TAB to switch to other application
> shows ESC [ I- in minibuffer. Similarly issue is seen with
> TERM=xterm-256color but not with rxvt.

I can reproduce this with Emacs 28, too.

emacs -Q -nw
C-h k
*click in a different window*


[-- Attachment #2: Type: image/png, Size: 54606 bytes --]

[-- Attachment #3: Type: text/plain, Size: 140 bytes --]


Anybody know what's going on here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45834: 28.0.50; Mouse events in terminal emacs
  2021-01-19  6:38 ` Lars Ingebrigtsen
@ 2021-01-19  8:24   ` Eli Zaretskii
  2021-01-19 15:22     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2021-01-19  8:24 UTC (permalink / raw)
  To: 45834, larsi

On January 19, 2021 8:38:07 AM GMT+02:00, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Brady <bug-gnu-emacs_at_gnu.org@tangential.info> writes:
> 
> > I just tested in a debian VM as well, with snapd's emacs 27.1, and
> the
> > same issue occurs, C-h k, then M-TAB to switch to other application
> > shows ESC [ I- in minibuffer. Similarly issue is seen with
> > TERM=xterm-256color but not with rxvt.
> 
> I can reproduce this with Emacs 28, too.
> 
> emacs -Q -nw
> C-h k
> *click in a different window*

I think it's the focus-in event that we somehow mishandle.  See xterm.el, search for "\e[I" (without the quotes).





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45834: 28.0.50; Mouse events in terminal emacs
  2021-01-19  8:24   ` Eli Zaretskii
@ 2021-01-19 15:22     ` Lars Ingebrigtsen
  2021-01-19 15:38       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-19 15:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 45834

Eli Zaretskii <eliz@gnu.org> writes:

> I think it's the focus-in event that we somehow mishandle.  See
> xterm.el, search for "\e[I" (without the quotes).

Instrumenting the  xterm-translate-focus-in/out functions shows that
they are being called, so that bit apparently works correctly?

However, if I say (read-event "foo: ") and then click on another window, 
I get the following return value, which...  I probably shouldn't?  Or
should I?

27[O

The reported test case is actually in

(read-key-sequence "foo: ")

and it won't actually return the \e[O, but will just append it to the
prompt.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45834: 28.0.50; Mouse events in terminal emacs
  2021-01-19 15:22     ` Lars Ingebrigtsen
@ 2021-01-19 15:38       ` Eli Zaretskii
  2021-01-19 15:41         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2021-01-19 15:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 45834

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 45834@debbugs.gnu.org
> Date: Tue, 19 Jan 2021 16:22:26 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I think it's the focus-in event that we somehow mishandle.  See
> > xterm.el, search for "\e[I" (without the quotes).
> 
> Instrumenting the  xterm-translate-focus-in/out functions shows that
> they are being called, so that bit apparently works correctly?
> 
> However, if I say (read-event "foo: ") and then click on another window, 
> I get the following return value, which...  I probably shouldn't?  Or
> should I?
> 
> 27[O
> 
> The reported test case is actually in
> 
> (read-key-sequence "foo: ")
> 
> and it won't actually return the \e[O, but will just append it to the
> prompt.

Does this work in Emacs 27?  If it does, I suspect one of the recent
changes in the input handling stuff...





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#45834: 28.0.50; Mouse events in terminal emacs
  2021-01-19 15:38       ` Eli Zaretskii
@ 2021-01-19 15:41         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-19 15:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 45834

Eli Zaretskii <eliz@gnu.org> writes:

> Does this work in Emacs 27?  If it does, I suspect one of the recent
> changes in the input handling stuff...

No, Emacs 27 also has the same problem.  Emacs 26.1 does not, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-19 15:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 23:29 bug#45834: 28.0.50; Mouse events in terminal emacs Brady
2021-01-19  6:38 ` Lars Ingebrigtsen
2021-01-19  8:24   ` Eli Zaretskii
2021-01-19 15:22     ` Lars Ingebrigtsen
2021-01-19 15:38       ` Eli Zaretskii
2021-01-19 15:41         ` Lars Ingebrigtsen

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git