Mouse presses not registering in windows-curses in terminal, but do in standalone CMD #11920

Closed
opened 2026-01-31 03:01:04 +00:00 by claunia · 2 comments
Owner

Originally created by @jwlodek on GitHub (Dec 30, 2020).

Environment

E:\>ver

Microsoft Windows [Version 10.0.18363.1256]

E:\>py --version
Python 3.7.0

E:\>pip freeze | grep curses
windows-curses==2.1.0

Steps to reproduce

Install windows curses:

pip install windows-curses

Run the following script:

import curses

screen = curses.initscr()
#curses.noecho()
curses.curs_set(0)
screen.keypad(1)
curses.mousemask(1)

screen.addstr("This is a Sample Curses Script\n\n")

while True:
    event = screen.getch()
    if event == ord("q"): break
    if event == curses.KEY_MOUSE:
        _, mx, my, _, _ = curses.getmouse()
        y, x = screen.getyx()
        screen.addstr(f"Mouse location:{mx}, {my}\n\n")

curses.endwin()

in command prompt, and then in windows terminal.

Click the mouse in random locations around the screen.

Expected behavior

Mouse presses detected and printed to screen (see screenshot from CMD):
image

Actual behavior

No mouse presses detected and nothing printed to screen.

Originally created by @jwlodek on GitHub (Dec 30, 2020). # Environment ```none E:\>ver Microsoft Windows [Version 10.0.18363.1256] E:\>py --version Python 3.7.0 E:\>pip freeze | grep curses windows-curses==2.1.0 ``` # Steps to reproduce Install windows curses: ``` pip install windows-curses ``` Run the following script: ```Python import curses screen = curses.initscr() #curses.noecho() curses.curs_set(0) screen.keypad(1) curses.mousemask(1) screen.addstr("This is a Sample Curses Script\n\n") while True: event = screen.getch() if event == ord("q"): break if event == curses.KEY_MOUSE: _, mx, my, _, _ = curses.getmouse() y, x = screen.getyx() screen.addstr(f"Mouse location:{mx}, {my}\n\n") curses.endwin() ``` in command prompt, and then in windows terminal. Click the mouse in random locations around the screen. # Expected behavior Mouse presses detected and printed to screen (see screenshot from CMD): ![image](https://user-images.githubusercontent.com/29227305/103380500-1105de80-4ab7-11eb-8689-5b35275b0913.png) # Actual behavior No mouse presses detected and nothing printed to screen.
claunia added the Resolution-Duplicate label 2026-01-31 03:01:04 +00:00
Author
Owner

@DHowett commented on GitHub (Jan 1, 2021):

Thanks for the report! This is a /duplicate of #376. The PTY infrastructure here supports passing through VT mouse events (for Windows and WSL applications), but not Win32 mouse events. Windows-curses is using native win32 mouse events.

@DHowett commented on GitHub (Jan 1, 2021): Thanks for the report! This is a /duplicate of #376. The PTY infrastructure here supports passing through VT mouse events (for Windows and WSL applications), but not Win32 mouse events. Windows-curses is using native win32 mouse events.
Author
Owner

@ghost commented on GitHub (Jan 1, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Jan 1, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11920