[VT Mouse Mode] No mouse tracking when window is unfocused #9067

Open
opened 2026-01-31 01:45:09 +00:00 by claunia · 2 comments
Owner

Originally created by @o-sdn-o on GitHub (Jun 16, 2020).

NOTES (@DHowett): gnome-terminal and xterm both emit mouse events when the window is unfocused, even on Windows. Perhaps we need to decide whether to do the same?


Steps to reproduce

Use WSL profile, enable the mouse tracking mode SGR (1006):

echo -e '\e[?1003;1006h'

Unfocus the terminal window.
Mouse movement on the window is no longer tracked when the terminal window loses focus.

Expected behavior

The terminal tracks mouse movement regardless of focus.

Actual behavior

The terminal does not track the mouse when the window is unfocused.

Originally created by @o-sdn-o on GitHub (Jun 16, 2020). **NOTES** (@DHowett): gnome-terminal and xterm both emit mouse events when the window is unfocused, even on Windows. Perhaps we need to decide whether to do the same? --- # Steps to reproduce Use WSL profile, enable the mouse tracking mode `SGR (1006)`: ```cmd echo -e '\e[?1003;1006h' ``` Unfocus the terminal window. Mouse movement on the window is no longer tracked when the terminal window loses focus. # Expected behavior The terminal tracks mouse movement regardless of focus. # Actual behavior The terminal does not track the mouse when the window is unfocused.
claunia added the Product-ConhostIssue-TaskArea-InputArea-VT labels 2026-01-31 01:45:09 +00:00
Author
Owner

@DHowett commented on GitHub (Jun 16, 2020):

I was ready to mark this one "by design," but xterm and gnome-terminal don't agree with me. This may have a follow-on effect for win32 mouse records. Before I commit this task to the backlog, though, I'd like to understand a couple things:

  1. Why would somebody want this?
  2. Should it be user-configurable?

/cc @zadjii-msft, who owned mouse events for conhost before WT and may recall why we didn't pass them through when the window wasn't focused.

@DHowett commented on GitHub (Jun 16, 2020): I was ready to mark this one "by design," but xterm and gnome-terminal don't agree with me. This may have a follow-on effect for _win32 mouse records_. Before I commit this task to the backlog, though, I'd like to understand a couple things: 1. Why would somebody want this? 2. Should it be user-configurable? /cc @zadjii-msft, who owned mouse events for conhost before WT and may recall why we didn't pass them through when the window wasn't focused.
Author
Owner

@zadjii-msft commented on GitHub (Jun 16, 2020):

I honestly don't remember - does conhost get mouse events when it's not focused? I was just turning mouse events into VT, I bet we don't even get them when the console isn't focused.

@zadjii-msft commented on GitHub (Jun 16, 2020): I honestly don't remember - does _conhost_ get mouse events when it's not focused? I was just turning mouse events into VT, I bet we don't even get them when the console isn't focused.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9067