unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Why have you disable mouse on TTY builds?
@ 2025-01-05  0:02 Angelo Graziosi
  2025-01-05  0:16 ` Angelo Graziosi
  2025-01-05  7:32 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Angelo Graziosi @ 2025-01-05  0:02 UTC (permalink / raw)
  To: emacs-devel

Few weeks ago I built Emacs master for TTY om MSYS2 and without any 
settings in the init.el file Emacs and mouse worked on Windows Terminal. 
Few minutes ago I did another TTY build and mouse stopped to work. I had 
to read this

   (require 'mouse)
   (require 'mwheel)
   (unless window-system
   (xterm-mouse-mode t)
   (mouse-wheel-mode t))

to the init.el..

WHY?

Thanks,
  Angelo.



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05  0:02 Why have you disable mouse on TTY builds? Angelo Graziosi
@ 2025-01-05  0:16 ` Angelo Graziosi
  2025-01-05  9:05   ` Eli Zaretskii
  2025-01-05  7:32 ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Angelo Graziosi @ 2025-01-05  0:16 UTC (permalink / raw)
  To: emacs-devel



Il 05/01/2025 01:02, Angelo Graziosi ha scritto:
> Few weeks ago I built Emacs master for TTY om MSYS2 and without any 
> settings in the init.el file Emacs and mouse worked on Windows Terminal. 
> Few minutes ago I did another TTY build and mouse stopped to work. I had 
> to re-add this
> 
>    (require 'mouse)
>    (require 'mwheel)
>    (unless window-system
>    (xterm-mouse-mode t)
>    (mouse-wheel-mode t))
> 
> to the init.el..
> 
> WHY?
> 

BTW, the TTY(*) build shows the following warning

$ grep -i warning emacs-master-tty-x86_64-20250104_115339-release-build.log
ac-wrapper: autoreconf: warning: auto-detected versions not found ( ); 
falling back to latest available
checking whether C compiler handles -Werror -Wunknown-warning-option... no
checking for C compiler option to allow warnings... -Wno-error
configure: WARNING: libattr development library was not found or not usable.
configure: WARNING: GNU Emacs will be built without xattr support.
dynamic-setting.el:59:12: Warning: the function ‘reconsider-frame-fonts’ 
is not known to be defined.
image.el:620:19: Warning: reference to free variable ‘image-scaling-factor’
image.el:1328:53: Warning: reference to free variable 
‘image-recompute-map-p’
image.el:1368:53: Warning: reference to free variable 
‘image-recompute-map-p’
image.el:1399:53: Warning: reference to free variable 
‘image-recompute-map-p’
image.el:1412:53: Warning: reference to free variable 
‘image-recompute-map-p’
term/android-win.el:64:4: Warning: the function ‘x-handle-args’ is not 
known to be defined.
w32-fns.el:55:16: Warning: reference to free variable ‘w32-system-shells’
w32-fns.el:99:9: Warning: reference to free variable 
‘w32-allow-system-shell’
dired.el:5365:38: Warning: the function ‘tool-bar--image-expression’ is 
not known to be defined.
   ELC      emacs-lisp/warnings.elc
net/eww.el:1445:35: Warning: reference to free variable 
‘image-scaling-factor’
net/shr.el:1297:51: Warning: reference to free variable 
‘image-scaling-factor’
net/shr.el:2079:49: Warning: reference to free variable 
‘image-scaling-factor’
org/org.el:20935:15: Warning: the function ‘dnd-open-local-file’ might 
not be defined at runtime.
./emacs-lisp/warnings.el
./emacs-lisp/warnings.elc

> Thanks,
>   Angelo.

---
(*) For MSYS2 build see 
https://github.com/msys2/MSYS2-packages/tree/master/emacs



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05  0:02 Why have you disable mouse on TTY builds? Angelo Graziosi
  2025-01-05  0:16 ` Angelo Graziosi
@ 2025-01-05  7:32 ` Eli Zaretskii
  2025-01-05  9:58   ` Angelo Graziosi
  1 sibling, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2025-01-05  7:32 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> Date: Sun, 5 Jan 2025 01:02:10 +0100
> From: Angelo Graziosi <angelo.g0@libero.it>
> 
> Few weeks ago I built Emacs master for TTY om MSYS2 and without any 
> settings in the init.el file Emacs and mouse worked on Windows Terminal. 
> Few minutes ago I did another TTY build and mouse stopped to work. I had 
> to read this
> 
>    (require 'mouse)
>    (require 'mwheel)
>    (unless window-system
>    (xterm-mouse-mode t)
>    (mouse-wheel-mode t))
> 
> to the init.el..
> 
> WHY?

Which revision did you build?  There were some changes lately
regarding xterm-mouse turned on by default, which could have affected
that, so it is important to know whether you build before or after
those changes.

Please, whenever you report a problem with Emacs, always provide the
information collected by report-emacs-bug.  That information is
important to quickly and efficiently investigate your reports.



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05  0:16 ` Angelo Graziosi
@ 2025-01-05  9:05   ` Eli Zaretskii
  2025-01-05 10:01     ` Angelo Graziosi
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2025-01-05  9:05 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel

> Date: Sun, 5 Jan 2025 01:16:08 +0100
> From: Angelo Graziosi <angelo.g0@libero.it>
> 
> BTW, the TTY(*) build shows the following warning

Did you report these issues to the MSYS2 folks?  They maintain the
package build scripts independently of the upstream project, so they
need to be told, IMO.

> $ grep -i warning emacs-master-tty-x86_64-20250104_115339-release-build.log
> ac-wrapper: autoreconf: warning: auto-detected versions not found ( ); 
> falling back to latest available

I don't get this here, and don't understand what that means.  Maybe
you have an Autoconf version that emits this for some reason.

> checking whether C compiler handles -Werror -Wunknown-warning-option... no
> checking for C compiler option to allow warnings... -Wno-error

These are normal.

> configure: WARNING: libattr development library was not found or not usable.
> configure: WARNING: GNU Emacs will be built without xattr support.

Do you have some xattr.h header file or libxattr library installed?
The configure script tells you these cannot be used (which is correct
for the Windows build).  I don't see these warnings here, but then I
don't have this library installed.

> dynamic-setting.el:59:12: Warning: the function ‘reconsider-frame-fonts’ 
> is not known to be defined.

I don't get this here, and there's already a declare-function form in
dynamic-setting.el and the call is guarded by display-graphic-p.  So I
don't see why you get this.

I attempted to fix the other wranings.



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05  7:32 ` Eli Zaretskii
@ 2025-01-05  9:58   ` Angelo Graziosi
  2025-01-05 11:10     ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Angelo Graziosi @ 2025-01-05  9:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



Il 05/01/2025 08:32, Eli Zaretskii ha scritto:
>> Date: Sun, 5 Jan 2025 01:02:10 +0100
>> From: Angelo Graziosi <angelo.g0@libero.it>
>>
>> Few weeks ago I built Emacs master for TTY om MSYS2 and without any
>> settings in the init.el file Emacs and mouse worked on Windows Terminal.
>> Few minutes ago I did another TTY build and mouse stopped to work. I had
>> to read this
>>
>>     (require 'mouse)
>>     (require 'mwheel)
>>     (unless window-system
>>     (xterm-mouse-mode t)
>>     (mouse-wheel-mode t))
>>
>> to the init.el..
>>
>> WHY?
> 
> Which revision did you build?  There were some changes lately
> regarding xterm-mouse turned on by default, which could have affected
> that, so it is important to know whether you build before or after
> those changes.

I built Emacs master after the mouse support was enable by default for 
TTY then have built Emacs master yesterday after the mouse support for 
TTY was disabled for a few terminals.

In Windows Terminal the mouse support worked. The real world is more 
complicated than the ideal world some programmer has in mind.





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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05  9:05   ` Eli Zaretskii
@ 2025-01-05 10:01     ` Angelo Graziosi
  0 siblings, 0 replies; 11+ messages in thread
From: Angelo Graziosi @ 2025-01-05 10:01 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel



Il 05/01/2025 10:05, Eli Zaretskii ha scritto:
>> Date: Sun, 5 Jan 2025 01:16:08 +0100
>> From: Angelo Graziosi 
>>
>> BTW, the TTY(*) build shows the following warning
> 
> Did you report these issues to the MSYS2 folks?  They maintain the
> package build scripts independently of the upstream project, so they
> need to be told, IMO.

I think some of them were flagged.. time ago.

>> $ grep -i warning emacs-master-tty-x86_64-20250104_115339-release-build.log
>> ac-wrapper: autoreconf: warning: auto-detected versions not found ( );
>> falling back to latest available

Already I flagged this to Emacs bug list but none understood it.


> I attempted to fix the other wranings.

Thanks



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05  9:58   ` Angelo Graziosi
@ 2025-01-05 11:10     ` Eli Zaretskii
  2025-01-05 12:12       ` Angelo Graziosi
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2025-01-05 11:10 UTC (permalink / raw)
  To: Angelo Graziosi, Jared Finder; +Cc: emacs-devel

> Date: Sun, 5 Jan 2025 10:58:48 +0100
> Cc: emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.g0@libero.it>
> 
> 
> 
> Il 05/01/2025 08:32, Eli Zaretskii ha scritto:
> >> Date: Sun, 5 Jan 2025 01:02:10 +0100
> >> From: Angelo Graziosi <angelo.g0@libero.it>
> >>
> >> Few weeks ago I built Emacs master for TTY om MSYS2 and without any
> >> settings in the init.el file Emacs and mouse worked on Windows Terminal.
> >> Few minutes ago I did another TTY build and mouse stopped to work. I had
> >> to read this
> >>
> >>     (require 'mouse)
> >>     (require 'mwheel)
> >>     (unless window-system
> >>     (xterm-mouse-mode t)
> >>     (mouse-wheel-mode t))
> >>
> >> to the init.el..
> >>
> >> WHY?
> > 
> > Which revision did you build?  There were some changes lately
> > regarding xterm-mouse turned on by default, which could have affected
> > that, so it is important to know whether you build before or after
> > those changes.
> 
> I built Emacs master after the mouse support was enable by default for 
> TTY then have built Emacs master yesterday after the mouse support for 
> TTY was disabled for a few terminals.
> 
> In Windows Terminal the mouse support worked.

Can you tell more about the terminal you are using?  How do you start
this terminal, and what program does it run?

Also, does it set TERM to some value, and if so, to which value?

> The real world is more complicated than the ideal world some
> programmer has in mind.

This is an unkind and unfair comment.  We are trying to do our best,
but the number of terminals we know about is always finite, so there's
always some terminal we didn't know about.

Jared, can you please look into this?



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05 11:10     ` Eli Zaretskii
@ 2025-01-05 12:12       ` Angelo Graziosi
  2025-01-05 16:53         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Angelo Graziosi @ 2025-01-05 12:12 UTC (permalink / raw)
  To: Eli Zaretskii, Jared Finder; +Cc: emacs-devel



Il 05/01/2025 12:10, Eli Zaretskii ha scritto:

>>
>> In Windows Terminal the mouse support worked.
> 
> Can you tell more about the terminal you are using?  How do you start
> this terminal, and what program does it run?
> 
> Also, does it set TERM to some value, and if so, to which value?

Windows Terminal is called in this way, it is 
https://github.com/microsoft/terminal/releases/tag/v1.22.3232.0

and one gets

$ echo $TERM
xterm-256color

BTW, I reinstalled the previous TTY build (pure MSYS2),

GNU Emacs 31.0.50 (build 1, x86_64-pc-cygwin) 
                                                 of 2024-12-20


and it works with mouse settings commented out in init.el

;;(require 'mouse)
     ;;(require 'mwheel)
     ;;(unless window-system
     ;;(xterm-mouse-mode t)
     ;;(mouse-wheel-mode t))

The same does not work with current master build for TTY.





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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05 12:12       ` Angelo Graziosi
@ 2025-01-05 16:53         ` Eli Zaretskii
  2025-01-05 17:35           ` Jared Finder
  2025-01-05 17:40           ` Angelo Graziosi
  0 siblings, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2025-01-05 16:53 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: jared, emacs-devel

> Date: Sun, 5 Jan 2025 13:12:43 +0100
> Cc: emacs-devel@gnu.org
> From: Angelo Graziosi <angelo.g0@libero.it>
> 
> > Can you tell more about the terminal you are using?  How do you start
> > this terminal, and what program does it run?
> > 
> > Also, does it set TERM to some value, and if so, to which value?
> 
> Windows Terminal is called in this way, it is 
> https://github.com/microsoft/terminal/releases/tag/v1.22.3232.0
> 
> and one gets
> 
> $ echo $TERM
> xterm-256color
> 
> BTW, I reinstalled the previous TTY build (pure MSYS2),
> 
> GNU Emacs 31.0.50 (build 1, x86_64-pc-cygwin) 
>                                                  of 2024-12-20
> 
> 
> and it works with mouse settings commented out in init.el
> 
> ;;(require 'mouse)
>      ;;(require 'mwheel)
>      ;;(unless window-system
>      ;;(xterm-mouse-mode t)
>      ;;(mouse-wheel-mode t))
> 
> The same does not work with current master build for TTY.

So I guess this terminal somehow doesn't pass this test in xterm.el:

             ;; Only automatically enable xterm mouse on terminals
             ;; confirmed to still support all critical editing
             ;; workflows (bug#74833).
             (or (string-match-p xterm--auto-xt-mouse-allowed-types
                                 (tty-type (selected-frame)))
                 (and-let* ((name-and-version (xterm--query-name-and-version)))
                   (string-match-p xterm--auto-xt-mouse-allowed-names
                                   name-and-version))))

It is strange that you have TERM set to xterm-256color, though.  I use
the same Windows Terminal, both with cmd.exe and with MSYS Bash, and I
don't see this value in any of them.  What shell do you run inside the
terminal?  Are you sure this setting of TERM is not something your
shell init files do?  Or maybe you use WSL or something?

The reason we added these tests to xterm.el is that some terminals
which set TERM to xterm don't really support the features we need, and
turning xterm-mouse-mode on those terminals has adverse effects.
xterm-mouse-mode was not enabled by default until very recently, so
terminals that don't pass these tests should work like they did before
we turned on xterm-mouse-mode by default on all terminals that pretend
to be xterm.



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05 16:53         ` Eli Zaretskii
@ 2025-01-05 17:35           ` Jared Finder
  2025-01-05 17:40           ` Angelo Graziosi
  1 sibling, 0 replies; 11+ messages in thread
From: Jared Finder @ 2025-01-05 17:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Angelo Graziosi, emacs-devel

On 2025-01-05 08:53, Eli Zaretskii wrote:
>> Date: Sun, 5 Jan 2025 13:12:43 +0100
>> Cc: emacs-devel@gnu.org
>> From: Angelo Graziosi <angelo.g0@libero.it>
>> 
>> > Can you tell more about the terminal you are using?  How do you start
>> > this terminal, and what program does it run?
>> >
>> > Also, does it set TERM to some value, and if so, to which value?
>> 
>> Windows Terminal is called in this way, it is
>> https://github.com/microsoft/terminal/releases/tag/v1.22.3232.0
>> 
>> and one gets
>> 
>> $ echo $TERM
>> xterm-256color
>> 
>> BTW, I reinstalled the previous TTY build (pure MSYS2),
>> 
>> GNU Emacs 31.0.50 (build 1, x86_64-pc-cygwin)
>>                                                  of 2024-12-20
>> 
>> 
>> and it works with mouse settings commented out in init.el
>> 
>> ;;(require 'mouse)
>>      ;;(require 'mwheel)
>>      ;;(unless window-system
>>      ;;(xterm-mouse-mode t)
>>      ;;(mouse-wheel-mode t))
>> 
>> The same does not work with current master build for TTY.
> 
> So I guess this terminal somehow doesn't pass this test in xterm.el:
> 
>              ;; Only automatically enable xterm mouse on terminals
>              ;; confirmed to still support all critical editing
>              ;; workflows (bug#74833).
>              (or (string-match-p xterm--auto-xt-mouse-allowed-types
>                                  (tty-type (selected-frame)))
>                  (and-let* ((name-and-version 
> (xterm--query-name-and-version)))
>                    (string-match-p xterm--auto-xt-mouse-allowed-names
>                                    name-and-version))))

This is my expectation as well. Windows Terminal does properly support 
OSC52 and xterm mouse modes, but has no good way to detect it. Windows 
Terminal does uniquely set WT_SESSION, but that's not forwarded over SSH 
in a default configuration.

I filed a bug on Windows Terminal to have it support an XTVERSION query 
(https://github.com/microsoft/terminal/issues/18382) and I hope they are 
able to address quickly like on the previous Emacs uncovered 
xterm-related issue I filed.

   -- MJF



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

* Re: Why have you disable mouse on TTY builds?
  2025-01-05 16:53         ` Eli Zaretskii
  2025-01-05 17:35           ` Jared Finder
@ 2025-01-05 17:40           ` Angelo Graziosi
  1 sibling, 0 replies; 11+ messages in thread
From: Angelo Graziosi @ 2025-01-05 17:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jared, emacs-devel



Il 05/01/2025 17:53, Eli Zaretskii ha scritto:

> So I guess this terminal somehow doesn't pass this test in xterm.el:
> 
>               ;; Only automatically enable xterm mouse on terminals
>               ;; confirmed to still support all critical editing
>               ;; workflows (bug#74833).
>               (or (string-match-p xterm--auto-xt-mouse-allowed-types
>                                   (tty-type (selected-frame)))
>                   (and-let* ((name-and-version (xterm--query-name-and-version)))
>                     (string-match-p xterm--auto-xt-mouse-allowed-names
>                                     name-and-version))))
> 
> It is strange that you have TERM set to xterm-256color, though.  I use
> the same Windows Terminal, both with cmd.exe and with MSYS Bash, and I
> don't see this value in any of them.  What shell do you run inside the
> terminal?  Are you sure this setting of TERM is not something your
> shell init files do?  Or maybe you use WSL or something?

I use bash. WT is configured in settings.json as

"colorScheme": "MSYS2-Theme",
                 "commandline": "C:/msys64/usr/bin/bash --login",
                 "environment":
                 {
                     "CHERE_INVOKING": "1",
                     "MSYS": "winsymlinks:nativestrict",
                     "MSYS2_PATH_TYPE": "inherit",
                     "MSYSTEM": "MSYS"
                 },
                 "guid": "{fc173dff-fd24-43df-b40e-28853998c744}",
                 "icon": "C:/msys64/msys2.ico",
                 "name": "MSYS2 MSYS Shell",
                 "startingDirectory": "C:/msys64/home/%USERNAME%"
...

In MSYS, UCRT64 and WSL, TERM has the same value xterm-256color. I 
grepped TERM in all .bashrc etc configuration files (also in /etc) but 
the result is empty.

MinTTY set TERM to xterm. If I start MinTTY (TERM==xterm) and there I 
type wsl to start WSL then even WSLstarted this way has TERM==xterm-256color

In short I did not find wher WT takes that value for TERM..





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

end of thread, other threads:[~2025-01-05 17:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-05  0:02 Why have you disable mouse on TTY builds? Angelo Graziosi
2025-01-05  0:16 ` Angelo Graziosi
2025-01-05  9:05   ` Eli Zaretskii
2025-01-05 10:01     ` Angelo Graziosi
2025-01-05  7:32 ` Eli Zaretskii
2025-01-05  9:58   ` Angelo Graziosi
2025-01-05 11:10     ` Eli Zaretskii
2025-01-05 12:12       ` Angelo Graziosi
2025-01-05 16:53         ` Eli Zaretskii
2025-01-05 17:35           ` Jared Finder
2025-01-05 17:40           ` Angelo Graziosi

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).