prompt-toolkit / prompt-toolkit/python-prompt-toolkit

mouse support not working in windows

Open
#1,232 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

Hi,

I'm not having any luck getting mouse to work with mouse_support=True. Tried manual enable application.output.enable_mouse_support() but no errors are thrown. Still finding my way around the lib, but looking to log event types and see what comes through.

So far on:
Windows 10 pro Version 10.0.19041, 64 bit
Windows 10 home Version 10.0.18363, 64 bit

I do not have access to a system where it does work for me, so far, only the above. And I haven't tried using kernel32 directly.

Interestingly mouse works fine through win32console, but both seem to be using windows api, so not sure what gives. I've been comparing libs and looked at https://github.com/peterbrittain/asciimatics, but I really like your layout engine and want to use pt.

Also worth noting, results are same for pt vs asciimatics ( which uses win32console, though I don't know if this makes any difference implementation-wise vs kernel32 ) in cmd.exe as well as powershell - pt no mouse, asciim works, but in the new Windows Terminal, neither work, but that's not surprising really, it's still pretty new.

I'll keep you posted, and please ask if there's anything I can do to help you get this sorted. :-)

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing mouse_support=True and application.output.enable_mouse_support() on the reported Windows 10 versions in cmd.exe and PowerShell. Compare the behavior with win32console and asciimatics, then verify that mouse events are received in the prompt-toolkit application on supported Windows terminals.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.