unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74220: invisible cursor
@ 2024-11-05 20:06 Avraham Pinkas
  2024-11-06 12:37 ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Avraham Pinkas @ 2024-11-05 20:06 UTC (permalink / raw)
  To: 74220


[-- Attachment #1.1: Type: text/plain, Size: 6087 bytes --]

in a terminal (TTY), while gpm-mouse-mode is enabled, the cursor is
invisible.


In GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
 cairo version 1.18.0) of 2024-04-01, modified by Debian built on
 lcy02-amd64-083
Windowing system distributor 'The X.Org Foundation', version 11.0.12302006
System Description: Ubuntu 24.04.1 LTS

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --with-cairo --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 -ffile-prefix-map=/build/emacs-0yuuFP/emacs-29.3+1=.
 -fstack-protector-strong -fstack-clash-protection -Wformat
 -Werror=format-security -fcf-protection
 -fdebug-prefix-map=/build/emacs-0yuuFP/emacs-29.3+1=/usr/src/emacs-1:29.3+1-1ubuntu2
 -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=3'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: en_IL.UTF-8
  value of $LC_NUMERIC: en_IL.UTF-8
  value of $LC_TIME: en_IL.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Info

Minor modes in effect:
  timeclock-mode-line-display: t
  save-place-mode: t
  display-time-mode: t
  display-battery-mode: t
  desktop-save-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  isearch-fold-quotes-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  size-indication-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug mule-util info comp comp-cstr warnings
cus-edit pp cus-start org-element org-persist org-id org-refile avl-tree
generator oc-basic cl-extra help-mode ol-eww eww xdg url-queue thingatpt
mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-art mm-uu
mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill
kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus
gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time gnus-spec
gnus-int gnus-range message sendmail yank-media puny rfc822 mml mml-sec
epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils
mailheader gnus-win gnus nnheader gnus-util text-property-search
mail-utils range mm-util mail-prsvr wid-edit ol-docview doc-view
filenotify jka-compr image-mode exif dired dired-loaddefs ol-bibtex
bibtex iso8601 ol-bbdb ol-w3m ol-doi org-link-doi org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete
pcomplete comint ansi-osc ansi-color ring org-list org-footnote
org-faces org-entities time-date noutline outline icons ob-emacs-lisp
ob-core ob-eval org-cycle org-table ol rx org-fold org-fold-core
org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs
org-version org-compat org-macs format-spec timeclock saveplace t-mouse
time battery dbus xml desktop frameset cus-load finder-inf package
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache
json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs
cl-lib devhelp rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 302460 20031)
 (symbols 48 23059 0)
 (strings 32 80296 8705)
 (string-bytes 1 2415212)
 (vectors 16 47382)
 (vector-slots 8 1486833 182483)
 (floats 8 399 265)
 (intervals 56 875 0)
 (buffers 984 15))

[-- Attachment #1.2: Type: text/html, Size: 6632 bytes --]

[-- Attachment #2: #*message*-20241021-192018# --]
[-- Type: application/octet-stream, Size: 4667 bytes --]

From: "Avraham M. Pinkas" <avraham@avraham-pinkas.mail-host-address-is-not-set>
To: bug-gnu-emacs@gnu.org
Subject: 29.3; invisible mouse cursor
--text follows this line--




In GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
 cairo version 1.18.0) of 2024-04-01, modified by Debian built on
 lcy02-amd64-083
System Description: Ubuntu 24.04.1 LTS

Configured using:
 'configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/libexec
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-libsystemd --with-pop=yes
 --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.3/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --without-gconf --with-mailutils
 --with-native-compilation --with-cairo --with-x=yes
 --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2
 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
 -ffile-prefix-map=/build/emacs-0yuuFP/emacs-29.3+1=. -fstack-protector-strong
 -fstack-clash-protection -Wformat -Werror=format-security
 -fcf-protection
 -fdebug-prefix-map=/build/emacs-0yuuFP/emacs-29.3+1=/usr/src/emacs-1:29.3+1-1ubuntu2
 -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=3'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2
XPM GTK3 ZLIB

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

Major mode: Fundamental

Minor modes in effect:
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-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
  blink-cursor-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: linux
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr ispell emacsbug message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils jka-compr disp-table info
time-date shortdoc text-property-search help-fns radix-tree mule-util
apropos comp comp-cstr warnings subr-x rx cl-seq cl-macs gv cl-extra
help-mode bytecomp byte-compile t-mouse term/linux cus-edit pp cus-start
cus-load icons wid-edit cl-loaddefs cl-lib devhelp rmc iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 120330 7582)
 (symbols 48 9540 0)
 (strings 32 29696 3846)
 (string-bytes 1 1002463)
 (vectors 16 15000)
 (vector-slots 8 314445 13915)
 (floats 8 96 435)
 (intervals 56 341 48)
 (buffers 984 14))

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

* bug#74220: invisible cursor
  2024-11-05 20:06 bug#74220: invisible cursor Avraham Pinkas
@ 2024-11-06 12:37 ` Eli Zaretskii
  2024-11-06 13:55   ` Robert Pluim
  2024-11-06 14:22   ` jared via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 14+ messages in thread
From: Eli Zaretskii @ 2024-11-06 12:37 UTC (permalink / raw)
  To: Avraham Pinkas, Jared Finder; +Cc: 74220

> From: Avraham Pinkas <ampinkas@gmail.com>
> Date: Tue, 5 Nov 2024 22:06:30 +0200
> 
> in a terminal (TTY), while gpm-mouse-mode is enabled, the cursor is invisible.

Does someone (Jared?) have a system with a gpm-mouse build and can
reproduce and debug this, please?





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

* bug#74220: invisible cursor
  2024-11-06 12:37 ` Eli Zaretskii
@ 2024-11-06 13:55   ` Robert Pluim
  2024-11-06 14:03     ` Gerd Möllmann
  2024-11-06 14:22   ` jared via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 14+ messages in thread
From: Robert Pluim @ 2024-11-06 13:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74220, Jared Finder, Avraham Pinkas

>>>>> On Wed, 06 Nov 2024 14:37:07 +0200, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Avraham Pinkas <ampinkas@gmail.com>
    >> Date: Tue, 5 Nov 2024 22:06:30 +0200
    >> 
    >> in a terminal (TTY), while gpm-mouse-mode is enabled, the cursor is invisible.

    Eli> Does someone (Jared?) have a system with a gpm-mouse build and can
    Eli> reproduce and debug this, please?

Remind us what this needs? A real linux console, ie not an xterm?

Robert
-- 





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

* bug#74220: invisible cursor
  2024-11-06 13:55   ` Robert Pluim
@ 2024-11-06 14:03     ` Gerd Möllmann
  0 siblings, 0 replies; 14+ messages in thread
From: Gerd Möllmann @ 2024-11-06 14:03 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Jared Finder, Eli Zaretskii, 74220, Avraham Pinkas

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Wed, 06 Nov 2024 14:37:07 +0200, Eli Zaretskii <eliz@gnu.org> said:
>
>     >> From: Avraham Pinkas <ampinkas@gmail.com>
>     >> Date: Tue, 5 Nov 2024 22:06:30 +0200
>     >> 
>     >> in a terminal (TTY), while gpm-mouse-mode is enabled, the cursor is invisible.
>
>     Eli> Does someone (Jared?) have a system with a gpm-mouse build and can
>     Eli> reproduce and debug this, please?
>
> Remind us what this needs? A real linux console, ie not an xterm?

Yes, GPM is for linux virtual consoles.





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

* bug#74220: invisible cursor
  2024-11-06 12:37 ` Eli Zaretskii
  2024-11-06 13:55   ` Robert Pluim
@ 2024-11-06 14:22   ` jared via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-06 15:38     ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 14+ messages in thread
From: jared via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-06 14:22 UTC (permalink / raw)
  To: Robert Pluim, Gerd Möllmann; +Cc: Eli Zaretskii, 74220, Avraham Pinkas

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

  
  
It requires both a Linux kernel with GPM support as well as an Emacs build with GPM enabled
  

  
I have tested GPM under a VM in the past. I can bring it up and check the state of things.   
  

  
   -- MJF
  

  

  
  
  
  
>   
> On Nov 6, 2024 at 6:03 AM, Gerd Möllmann  <gerd.moellmann@gmail.com>  wrote:
>   
>   
>  Robert Pluim  <rpluim@gmail.com>  writes:
>
> >>>>>>  On Wed, 06 Nov 2024 14:37:07 +0200, Eli Zaretskii  <eliz@gnu.org>  said:
> >
> >   >>  From: Avraham Pinkas  <ampinkas@gmail.com>
> >   >>  Date: Tue, 5 Nov 2024 22:06:30 +0200
> >   >>   
> >   >>  in a terminal (TTY), while gpm-mouse-mode is enabled, the cursor is invisible.
> >
> >  Eli>  Does someone (Jared?) have a system with a gpm-mouse build and can
> >  Eli>  reproduce and debug this, please?
> >
> >  Remind us what this needs? A real linux console, ie not an xterm?
>
> Yes, GPM is for linux virtual consoles.
>     
     

[-- Attachment #2: Type: text/html, Size: 1536 bytes --]

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

* bug#74220: invisible cursor
  2024-11-06 14:22   ` jared via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-06 15:38     ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-06 16:17       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 14+ messages in thread
From: Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-06 15:38 UTC (permalink / raw)
  To: Robert Pluim, Gerd Möllmann; +Cc: Eli Zaretskii, 74220, Avraham Pinkas

>> On Nov 6, 2024 at 6:03 AM, Gerd Möllmann <gerd.moellmann@gmail.com> 
>> wrote:
>> 
>> Robert Pluim <rpluim@gmail.com> writes:
>> 
>>>>>>>> On Wed, 06 Nov 2024 14:37:07 +0200, Eli Zaretskii <eliz@gnu.org> 
>>>>>>>> said:
>>> 
>>>>> From: Avraham Pinkas <ampinkas@gmail.com>
>>>>> Date: Tue, 5 Nov 2024 22:06:30 +0200
>>>>> 
>>>>> in a terminal (TTY), while gpm-mouse-mode is enabled, the cursor is 
>>>>> invisible.
>>> 
>>> Eli> Does someone (Jared?) have a system with a gpm-mouse build and 
>>> can
>>> Eli> reproduce and debug this, please?
>>> 
>>> Remind us what this needs? A real linux console, ie not an xterm?
>> 
>> Yes, GPM is for linux virtual consoles.

I tested this locally at HEAD (b5845e) on Linux debian 6.1.0-13-amd64 
and everything is working fine.

Could you please describe what terminal (the output of "echo $TERM") and 
kernel version (the output of "uname -a") you are using when you have 
this issue? Can you try toggling M-x gpm-mouse-mode on and off and share 
if any errors are reported?

   -- MJF





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

* bug#74220: invisible cursor
  2024-11-06 15:38     ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-06 16:17       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-18  1:37         ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-06 16:17 UTC (permalink / raw)
  To: 74220; +Cc: jared, rpluim, gerd.moellmann, ampinkas, eliz

On Wed, 06 Nov 2024 07:38:52 -0800 Jared Finder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> wrote:

>>> On Nov 6, 2024 at 6:03 AM, Gerd Möllmann <gerd.moellmann@gmail.com> wrote:
>>> Robert Pluim <rpluim@gmail.com> writes:
>>> 
>>>>>>>>> On Wed, 06 Nov 2024 14:37:07 +0200, Eli Zaretskii <eliz@gnu.org>
>>>>>>>>> said:
>>>> 
>>>>>> From: Avraham Pinkas <ampinkas@gmail.com>
>>>>>> Date: Tue, 5 Nov 2024 22:06:30 +0200
>>>>>> in a terminal (TTY), while gpm-mouse-mode is enabled, the cursor is
>>>>>> invisible.
>>>> Eli> Does someone (Jared?) have a system with a gpm-mouse build and can
>>>> Eli> reproduce and debug this, please?
>>>> Remind us what this needs? A real linux console, ie not an xterm?
>>> Yes, GPM is for linux virtual consoles.
>
> I tested this locally at HEAD (b5845e) on Linux debian 6.1.0-13-amd64 and
> everything is working fine.
>
> Could you please describe what terminal (the output of "echo $TERM") and
> kernel version (the output of "uname -a") you are using when you have this
> issue? Can you try toggling M-x gpm-mouse-mode on and off and share if any
> errors are reported?

I can reproduce the issue in the Linux terminal (echo $TERM => linux,
uname -a => Linux strobelfssd 6.10.6 #1 SMP PREEMPT_DYNAMIC Mon Aug 19
12:15:23 CEST 2024 x86_64 GNU/Linux).  When I start emacs there with -Q,
`C-h v gpm-mouse-mode' says the value is t and I see the blinking cursor
in the emacs window, but moving the mouse I see no gpm cursor, though I
can make and yank selections and pull down menus in Emacs with the mouse
(the blinking cursor is not moved by the mouse).  When I type `M-x
gpm-mouse-mode' there are no errors and a cursor appears that moves with
the mouse (the blinking cursor remains visible and unresponsive to the
mouse), though `C-h v gpm-mouse-mode' now says the value is nil; I can
make selections as before (though the highlighting is a different color
than before) but I cannot pull down menus with the mouse.  This is with
emacs-29, emacs-30 and master.

Steve Berman





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

* bug#74220: invisible cursor
  2024-11-06 16:17       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-18  1:37         ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-28  3:13           ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 14+ messages in thread
From: Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-18  1:37 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 74220, gerd.moellmann, ampinkas, eliz, rpluim

On 2024-11-06 08:17, Stephen Berman wrote:
> On Wed, 06 Nov 2024 07:38:52 -0800 Jared Finder via "Bug reports for 
> GNU Emacs, the Swiss army knife of text editors" 
> <bug-gnu-emacs@gnu.org> wrote:
> 
>> I tested this locally at HEAD (b5845e) on Linux debian 6.1.0-13-amd64 
>> and
>> everything is working fine.
>> 
>> Could you please describe what terminal (the output of "echo $TERM") 
>> and
>> kernel version (the output of "uname -a") you are using when you have 
>> this
>> issue? Can you try toggling M-x gpm-mouse-mode on and off and share if 
>> any
>> errors are reported?
> 
> I can reproduce the issue in the Linux terminal (echo $TERM => linux,
> uname -a => Linux strobelfssd 6.10.6 #1 SMP PREEMPT_DYNAMIC Mon Aug 19
> 12:15:23 CEST 2024 x86_64 GNU/Linux).  When I start emacs there with 
> -Q,

Thank you, I am able to reproduce the issue locally on "Linux debian 
6.11.5+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.5-1~bpo12+1 
(2024-11-11) x86_64 GNU=Linux". I will investigate.

   -- MJF





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

* bug#74220: invisible cursor
  2024-11-18  1:37         ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-28  3:13           ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-28 18:21             ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 14+ messages in thread
From: Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-28  3:13 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 74220, gerd.moellmann, ampinkas, eliz, rpluim

On 2024-11-17 17:37, Jared Finder wrote:
> On 2024-11-06 08:17, Stephen Berman wrote:
>> On Wed, 06 Nov 2024 07:38:52 -0800 Jared Finder via "Bug reports for 
>> GNU Emacs, the Swiss army knife of text editors" 
>> <bug-gnu-emacs@gnu.org> wrote:
>> 
>>> I tested this locally at HEAD (b5845e) on Linux debian 6.1.0-13-amd64 
>>> and
>>> everything is working fine.
>>> 
>>> Could you please describe what terminal (the output of "echo $TERM") 
>>> and
>>> kernel version (the output of "uname -a") you are using when you have 
>>> this
>>> issue? Can you try toggling M-x gpm-mouse-mode on and off and share 
>>> if any
>>> errors are reported?
>> 
>> I can reproduce the issue in the Linux terminal (echo $TERM => linux,
>> uname -a => Linux strobelfssd 6.10.6 #1 SMP PREEMPT_DYNAMIC Mon Aug 19
>> 12:15:23 CEST 2024 x86_64 GNU/Linux).  When I start emacs there with 
>> -Q,
> 
> Thank you, I am able to reproduce the issue locally on "Linux debian 
> 6.11.5+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.5-1~bpo12+1 
> (2024-11-11) x86_64 GNU=Linux". I will investigate.

This appears to be due to something happening at a lower level than 
Emacs, though perhaps Emacs is not interfacing with GPM correctly.

This started happening in multiple Emacs versions with Linux 6.7. I 
tested HEAD, 29.4, and 28.2 -- all three versions worked fine with Linux 
6.6.63 and then exhibit this bug starting with Linux 6.7. 
GPM_DrawPointer is still being called, of course (since this works in 
previous Linux versions), but is no longer having any effect.

I will keep investigating here.

   -- MJF





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

* bug#74220: invisible cursor
  2024-11-28  3:13           ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-28 18:21             ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-28 20:20               ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-28 18:21 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 74220, gerd.moellmann, ampinkas, eliz, rpluim

On 2024-11-27 19:13, Jared Finder wrote:
> On 2024-11-17 17:37, Jared Finder wrote:
>> On 2024-11-06 08:17, Stephen Berman wrote:
>>> On Wed, 06 Nov 2024 07:38:52 -0800 Jared Finder via "Bug reports for 
>>> GNU Emacs, the Swiss army knife of text editors" 
>>> <bug-gnu-emacs@gnu.org> wrote:
>>> 
>>>> I tested this locally at HEAD (b5845e) on Linux debian 
>>>> 6.1.0-13-amd64 and
>>>> everything is working fine.
>>>> 
>>>> Could you please describe what terminal (the output of "echo $TERM") 
>>>> and
>>>> kernel version (the output of "uname -a") you are using when you 
>>>> have this
>>>> issue? Can you try toggling M-x gpm-mouse-mode on and off and share 
>>>> if any
>>>> errors are reported?
>>> 
>>> I can reproduce the issue in the Linux terminal (echo $TERM => linux,
>>> uname -a => Linux strobelfssd 6.10.6 #1 SMP PREEMPT_DYNAMIC Mon Aug 
>>> 19
>>> 12:15:23 CEST 2024 x86_64 GNU/Linux).  When I start emacs there with 
>>> -Q,
>> 
>> Thank you, I am able to reproduce the issue locally on "Linux debian 
>> 6.11.5+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.11.5-1~bpo12+1 
>> (2024-11-11) x86_64 GNU=Linux". I will investigate.
> 
> This appears to be due to something happening at a lower level than 
> Emacs, though perhaps Emacs is not interfacing with GPM correctly.
> 
> This started happening in multiple Emacs versions with Linux 6.7. I 
> tested HEAD, 29.4, and 28.2 -- all three versions worked fine with 
> Linux 6.6.63 and then exhibit this bug starting with Linux 6.7. 
> GPM_DrawPointer is still being called, of course (since this works in 
> previous Linux versions), but is no longer having any effect.
> 
> I will keep investigating here.

AH HA!

This was an intentional change to Linux 6.7 to avoid a potential 
privilege escalation. Specifically, apps without the capability 
CAP_SYS_ADMIN are no longer able to set the kernel selection buffer. 
Across Emacs versions, granting the Emacs binary the CAP_SYS_ADMIN 
capability (sudo setcap cap_sys_admin+ep path/to/emacs) fixes the issue.

But is this the right fix? CAP_SYS_ADMIN grants many dangerous 
capabilities on Linux. An alternative fix would be to update redisplay 
on terminals to draw the mouse cursor. Perhaps this is what is done on 
other OSes? I would like guidance here on which path is recommended.

   -- MJF





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

* bug#74220: invisible cursor
  2024-11-28 18:21             ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-28 20:20               ` Eli Zaretskii
  2024-11-28 21:45                 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2024-11-28 20:20 UTC (permalink / raw)
  To: Jared Finder; +Cc: 74220, gerd.moellmann, ampinkas, stephen.berman, rpluim

> Date: Thu, 28 Nov 2024 10:21:53 -0800
> From: Jared Finder <jared@finder.org>
> Cc: "Jared Finder via \"Bug reports for GNU Emacs, the Swiss army knife of
>  text editors\"" <bug-gnu-emacs@gnu.org>, Robert Pluim <rpluim@gmail.com>,
>  Gerd Möllmann <gerd.moellmann@gmail.com>, Eli Zaretskii
>  <eliz@gnu.org>, 74220 <74220@debbugs.gnu.org>, Avraham Pinkas
>  <ampinkas@gmail.com>
> 
> This was an intentional change to Linux 6.7 to avoid a potential 
> privilege escalation. Specifically, apps without the capability 
> CAP_SYS_ADMIN are no longer able to set the kernel selection buffer. 
> Across Emacs versions, granting the Emacs binary the CAP_SYS_ADMIN 
> capability (sudo setcap cap_sys_admin+ep path/to/emacs) fixes the issue.

Sorry, I don't follow: what does setting the kernel selection buffer
have to do with showing the cursor?  And how is it related to GPM?
What am I missing here?

> But is this the right fix? CAP_SYS_ADMIN grants many dangerous 
> capabilities on Linux. An alternative fix would be to update redisplay 
> on terminals to draw the mouse cursor. Perhaps this is what is done on 
> other OSes? I would like guidance here on which path is recommended.

Let's first understand the problem better.

(And I'm guessing that by "cursor" you mean "mouse pointer"?)





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

* bug#74220: invisible cursor
  2024-11-28 20:20               ` Eli Zaretskii
@ 2024-11-28 21:45                 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-11-29  7:32                   ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-28 21:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 74220, gerd.moellmann, ampinkas, stephen.berman, rpluim

On 2024-11-28 12:20, Eli Zaretskii wrote:
>> Date: Thu, 28 Nov 2024 10:21:53 -0800
>> From: Jared Finder <jared@finder.org>
>> Cc: "Jared Finder via \"Bug reports for GNU Emacs, the Swiss army 
>> knife of
>>  text editors\"" <bug-gnu-emacs@gnu.org>, Robert Pluim 
>> <rpluim@gmail.com>,
>>  Gerd Möllmann <gerd.moellmann@gmail.com>, Eli Zaretskii
>>  <eliz@gnu.org>, 74220 <74220@debbugs.gnu.org>, Avraham Pinkas
>>  <ampinkas@gmail.com>
>> 
>> This was an intentional change to Linux 6.7 to avoid a potential
>> privilege escalation. Specifically, apps without the capability
>> CAP_SYS_ADMIN are no longer able to set the kernel selection buffer.
>> Across Emacs versions, granting the Emacs binary the CAP_SYS_ADMIN
>> capability (sudo setcap cap_sys_admin+ep path/to/emacs) fixes the 
>> issue.
> 
> Sorry, I don't follow: what does setting the kernel selection buffer
> have to do with showing the cursor?  And how is it related to GPM?
> What am I missing here?
> 
>> But is this the right fix? CAP_SYS_ADMIN grants many dangerous
>> capabilities on Linux. An alternative fix would be to update redisplay
>> on terminals to draw the mouse cursor. Perhaps this is what is done on
>> other OSes? I would like guidance here on which path is recommended.
> 
> Let's first understand the problem better.
> 
> (And I'm guessing that by "cursor" you mean "mouse pointer"?)

Here's some more specifics:

Emacs draws the mouse pointer in handle_one_term_event in term.c. It 
does this by calling GPM_DrawPointer() with the intended x and y. This 
code is pretty old, a blame says it was from 2007.

GPM_DrawPointer is just a macro, see the GitHub mirror: 
https://github.com/telmich/gpm/blob/master/src/headers/gpm.h#L235. This 
calls a Linux ioctl() to draw the cursor. This code is also pretty old, 
a blame says it was from 2005.

The Linux ioctl() is called as follows, if it used symbolic constants 
and a struct instead of magic byte values:

struct {
     char  subcode;
     short xs, ys, xe, ye;
     short sel_mode;
} gpmbuf;

gpmbuf.subcode = TIOCL_SETSEL; // 2
gpmbuf.xs = gpmbuf.xe = x;
gpmbuf.ys = gpmbuf.ye = y;
gpmbuf.selmode = TIOCL_SELPOINTER; //3
ioctl(fd, TIOCLINUX, &gpmbuf);

This adds one other solution -- I could see if it is reasonable for the 
Linux kernel to not protect TIOCL_SELPOINTER while protecting the rest 
of TIOCL_SETSEL. I'm a bit nervous here as I don't understand the 
security implications of SELPOINTER vs other selections, though on first 
glance it seems reasonable.

   -- MJF





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

* bug#74220: invisible cursor
  2024-11-28 21:45                 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-11-29  7:32                   ` Eli Zaretskii
  2024-11-29 19:12                     ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2024-11-29  7:32 UTC (permalink / raw)
  To: Jared Finder; +Cc: gerd.moellmann, rpluim, stephen.berman, 74220, ampinkas

> Date: Thu, 28 Nov 2024 13:45:49 -0800
> From: Jared Finder <jared@finder.org>
> Cc: stephen.berman@gmx.net, bug-gnu-emacs@gnu.org, rpluim@gmail.com,
>  gerd.moellmann@gmail.com, 74220@debbugs.gnu.org, ampinkas@gmail.com
> 
> On 2024-11-28 12:20, Eli Zaretskii wrote:
> > 
> > Sorry, I don't follow: what does setting the kernel selection buffer
> > have to do with showing the cursor?  And how is it related to GPM?
> > What am I missing here?
> > 
> >> But is this the right fix? CAP_SYS_ADMIN grants many dangerous
> >> capabilities on Linux. An alternative fix would be to update redisplay
> >> on terminals to draw the mouse cursor. Perhaps this is what is done on
> >> other OSes? I would like guidance here on which path is recommended.
> > 
> > Let's first understand the problem better.
> > 
> > (And I'm guessing that by "cursor" you mean "mouse pointer"?)
> 
> Here's some more specifics:
> 
> Emacs draws the mouse pointer in handle_one_term_event in term.c. It 
> does this by calling GPM_DrawPointer() with the intended x and y. This 
> code is pretty old, a blame says it was from 2007.
> 
> GPM_DrawPointer is just a macro, see the GitHub mirror: 
> https://github.com/telmich/gpm/blob/master/src/headers/gpm.h#L235. This 
> calls a Linux ioctl() to draw the cursor. This code is also pretty old, 
> a blame says it was from 2005.
> 
> The Linux ioctl() is called as follows, if it used symbolic constants 
> and a struct instead of magic byte values:
> 
> struct {
>      char  subcode;
>      short xs, ys, xe, ye;
>      short sel_mode;
> } gpmbuf;
> 
> gpmbuf.subcode = TIOCL_SETSEL; // 2
> gpmbuf.xs = gpmbuf.xe = x;
> gpmbuf.ys = gpmbuf.ye = y;
> gpmbuf.selmode = TIOCL_SELPOINTER; //3
> ioctl(fd, TIOCLINUX, &gpmbuf);

Thanks.  I think I see a far-away light at the end of the tunnel, but
I'm not yet sure whether it's daylight or the proverbial train.
What's missing in the above is the relation to "kernel selection
buffer".  I'm guessing that TIOCL_SETSEL is "setting the kernel
selection buffer", given its name, but I'm not sure.

> This adds one other solution -- I could see if it is reasonable for the 
> Linux kernel to not protect TIOCL_SELPOINTER while protecting the rest 
> of TIOCL_SETSEL. I'm a bit nervous here as I don't understand the 
> security implications of SELPOINTER vs other selections, though on first 
> glance it seems reasonable.

I actually wonder about something else: did the kernel developers
_intend_ to break mouse pointer drawing by GPM? or maybe they intend
to deprecate GPM as a whole?  I mean, Emacs is presumably not the only
application that uses GPM, and what you describe above is part of GPM
code, right?  So GPM should be now broken for all the other
applications as well, right?

A related question is how many Emacs users are there nowadays who run
Emacs on the Linux console and use the mouse?

If the Linux kernel developers intend to deprecate/drop GPM, and/or
GPM use in Emacs on the Linux console is not popular enough, we could
just document the need for CAP_SYS_ADMIN capability, and move on.  (We
should add that to PROBLEMS anyway, because people might be using past
Emacs versions where nothing else will work.)

Of course, if there's a better method of fixing this, we should try
it.  But since AFAIU the mouse pointer is drawn by GPM itself (am I
right?), it sounds like the fix should be done by GPM developers, no?





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

* bug#74220: invisible cursor
  2024-11-29  7:32                   ` Eli Zaretskii
@ 2024-11-29 19:12                     ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 14+ messages in thread
From: Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-11-29 19:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gerd.moellmann, rpluim, stephen.berman, 74220, ampinkas

On 2024-11-28 23:32, Eli Zaretskii wrote:
>> Date: Thu, 28 Nov 2024 13:45:49 -0800
>> From: Jared Finder <jared@finder.org>
>> Cc: stephen.berman@gmx.net, bug-gnu-emacs@gnu.org, rpluim@gmail.com,
>>  gerd.moellmann@gmail.com, 74220@debbugs.gnu.org, ampinkas@gmail.com
>> 
>> >> But is this the right fix? CAP_SYS_ADMIN grants many dangerous
>> >> capabilities on Linux. An alternative fix would be to update redisplay
>> >> on terminals to draw the mouse cursor. Perhaps this is what is done on
>> >> other OSes? I would like guidance here on which path is recommended.
>> >
>> > Let's first understand the problem better.
>> >
>> > (And I'm guessing that by "cursor" you mean "mouse pointer"?)
>> 
>> Here's some more specifics:
>> 
>> Emacs draws the mouse pointer in handle_one_term_event in term.c. It
>> does this by calling GPM_DrawPointer() with the intended x and y. This
>> code is pretty old, a blame says it was from 2007.
>> 
>> GPM_DrawPointer is just a macro, see the GitHub mirror:
>> https://github.com/telmich/gpm/blob/master/src/headers/gpm.h#L235. 
>> This
>> calls a Linux ioctl() to draw the cursor. This code is also pretty 
>> old,
>> a blame says it was from 2005.
>> 
>> The Linux ioctl() is called as follows, if it used symbolic constants
>> and a struct instead of magic byte values:
>> 
>> struct {
>>      char  subcode;
>>      short xs, ys, xe, ye;
>>      short sel_mode;
>> } gpmbuf;
>> 
>> gpmbuf.subcode = TIOCL_SETSEL; // 2
>> gpmbuf.xs = gpmbuf.xe = x;
>> gpmbuf.ys = gpmbuf.ye = y;
>> gpmbuf.selmode = TIOCL_SELPOINTER; //3
>> ioctl(fd, TIOCLINUX, &gpmbuf);
> 
> Thanks.  I think I see a far-away light at the end of the tunnel, but
> I'm not yet sure whether it's daylight or the proverbial train.
> What's missing in the above is the relation to "kernel selection
> buffer".  I'm guessing that TIOCL_SETSEL is "setting the kernel
> selection buffer", given its name, but I'm not sure.

Yes, exactly.

The same TIOCL_SETSEL is also used for actually setting the selection. 
If selmode is TIOCL_SELCHAR, TIOCL_SELWORD, or TIOCL_SELLINE then the 
region from start to end is copied into a kernel-level buffer that can 
be pasted with TIOCL_PASTESEL.

The same TIOCL_SETSEL is also used for changes that appear to be 
completely unrelated to the kernel managed selection buffer.  Namely the 
following three modes: TIOCL_SELPOINTER, TIOCL_SELCLEAR (it only 
controls visuals), TIOCL_SELMOUSEREPORT (it reports the selection start 
coordinate).

>> This adds one other solution -- I could see if it is reasonable for 
>> the
>> Linux kernel to not protect TIOCL_SELPOINTER while protecting the rest
>> of TIOCL_SETSEL. I'm a bit nervous here as I don't understand the
>> security implications of SELPOINTER vs other selections, though on 
>> first
>> glance it seems reasonable.
> 
> I actually wonder about something else: did the kernel developers
> _intend_ to break mouse pointer drawing by GPM? or maybe they intend
> to deprecate GPM as a whole?  I mean, Emacs is presumably not the only
> application that uses GPM, and what you describe above is part of GPM
> code, right?  So GPM should be now broken for all the other
> applications as well, right?

GPM was explicitly intended to be supported from the Linux kernel 
discussions. 
https://lwn.net/ml/kernel-hardening/2023082203-slackness-sworn-2c80@gregkh/.

I think Emacs is a special snowflake in that it doesn't (possibly 
can't?) rely on the GPM daemon drawing the mouse pointer. I did not see 
any other app with this problem. I tested Vim, Midnight Commander, Nano, 
and Bash. I don't know what is special about Emacs here. Perhaps the 
character under the mouse pointer is treated special in redisplay? Not 
sure.

I will reach out to the kernel mailing list and see if they are ok 
relaxing the check and fixing this on their end.

   -- MJF





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

end of thread, other threads:[~2024-11-29 19:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 20:06 bug#74220: invisible cursor Avraham Pinkas
2024-11-06 12:37 ` Eli Zaretskii
2024-11-06 13:55   ` Robert Pluim
2024-11-06 14:03     ` Gerd Möllmann
2024-11-06 14:22   ` jared via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-06 15:38     ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-06 16:17       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-18  1:37         ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-28  3:13           ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-28 18:21             ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-28 20:20               ` Eli Zaretskii
2024-11-28 21:45                 ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-29  7:32                   ` Eli Zaretskii
2024-11-29 19:12                     ` Jared Finder via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).