Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Windows: main-screen mouse tracking requires WT_SESSION, so it never enables inside herdr panes

Open Beginner friendly
#3,353 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
66/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

The mouse gate is in applyMouseTracking in packages/tui/src/tui-main-screen.ts, where the win32 check tests only WT_SESSION. Read that function, then reproduce by calling it with process.stdout.isTTY true, a recording terminal.write, and HERDR_ENV=1 on win32. Done means HERDR_ENV=1 enables mouse tracking while a plain console stays excluded. The reporter has not confirmed that herdr forwards mouse reports, so check that with a maintainer before opening a PR.

Written by the indexing model from the issue text.

Description

What happened?

On Windows, TuiMainScreen.applyMouseTracking (packages/tui/src/tui-main-screen.ts) counts a terminal as mouse-capable only when WT_SESSION is set:

(process.platform !== "win32" || Boolean(process.env.WT_SESSION))

A herdr pane on Windows is not Windows Terminal and does not set WT_SESSION, so inside it the mouse-enable sequence is never written, even with terminal.mouse: "always". The clickable pending-question blocks from #1645 therefore have no mouse input there. Senpi already recognises herdr panes by HERDR_ENV === "1" (builtin herdr extension, index.ts).

Steps to reproduce

Calling applyMouseTracking(true) on a TuiMainScreen with process.stdout.isTTY true and a recording terminal.write, against the shipped @code-yeongyu/senpi-tui 2026.10.13 dist on win32:

HERDR_ENV=1:      mouse enabled=false
WT_SESSION=x:     mouse enabled=true
neither:          mouse enabled=false

The gate is unchanged on main (b8c1d3a84). I have not clicked in a live herdr pane with tracking forced on, so I cannot confirm yet that herdr 0.9.3 on Windows forwards SGR mouse reports to the pane. If it does not, this is a herdr limitation and can be closed.

Expected behavior

A herdr pane on Windows enables mouse tracking like Windows Terminal, and a plain console stays excluded:

-			(process.platform !== "win32" || Boolean(process.env.WT_SESSION));
+			(process.platform !== "win32" || Boolean(process.env.WT_SESSION) || process.env.HERDR_ENV === "1");

With that change the check above prints HERDR_ENV=1: mouse enabled=true; the other two lines are unchanged. An alternative is to let an explicit terminal.mouse: "always" bypass the win32 host gate, which needs the mode passed into the TUI. I can send either as a PR after a Contribution Proposal if you want one.

Version

2026.10.13 (@code-yeongyu/senpi-tui), Windows 11, herdr 0.9.3, Bun 1.4.3.

Disclosure: drafted with an AI coding agent from my own session logs; I ran the offline check quoted above.

Dominant language
TypeScript
Stars
479
Forks
139
Avg merge
7h 37m
Merged PRs (30d)
792

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from code-yeongyu/senpi

All issues in code-yeongyu/senpi

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.