Skip to content

refactor(tui): drop dependency windows-curses#149

Draft
XuehaiPan wants to merge 8 commits intomainfrom
drop-windows-curses
Draft

refactor(tui): drop dependency windows-curses#149
XuehaiPan wants to merge 8 commits intomainfrom
drop-windows-curses

Conversation

@XuehaiPan
Copy link
Copy Markdown
Owner

Issue Type

  • Improvement/feature implementation

Description

Drop dependency windows-curses to enable Windows support.

Motivation and Context

Drop dependency windows-curses to enable Windows support.

@XuehaiPan XuehaiPan added cli / tui Something related to the CLI dependencies Pull requests that update a dependency file labels Jan 30, 2025
@XuehaiPan XuehaiPan self-assigned this Jan 30, 2025
@XuehaiPan XuehaiPan force-pushed the drop-windows-curses branch 4 times, most recently from d966d10 to 06a82d1 Compare January 31, 2025 17:44
@XuehaiPan XuehaiPan force-pushed the drop-windows-curses branch 3 times, most recently from 38ec3c4 to 709ef1f Compare April 25, 2025 14:46
@XuehaiPan XuehaiPan force-pushed the drop-windows-curses branch from 709ef1f to a573710 Compare May 3, 2025 17:38
@XuehaiPan XuehaiPan force-pushed the drop-windows-curses branch from a573710 to 30f1590 Compare May 31, 2025 14:37
@XuehaiPan XuehaiPan linked an issue Aug 31, 2025 that may be closed by this pull request
@XuehaiPan XuehaiPan force-pushed the drop-windows-curses branch 5 times, most recently from bf0c7c8 to 55b91e8 Compare October 19, 2025 05:47
@XuehaiPan XuehaiPan force-pushed the main branch 5 times, most recently from 9de1ff4 to 07c4819 Compare November 12, 2025 05:01
@XuehaiPan XuehaiPan force-pushed the drop-windows-curses branch from 7492690 to 319e88f Compare February 1, 2026 11:27
- Add complete terminal handling with screen buffer management
- Implement keyboard and mouse input (SGR extended mouse protocol)
- Add support for text attributes, colors, and ACS line-drawing characters
- Handle wide characters and combining character merging
- Support both Windows (msvcrt) and Unix (termios) platforms
- Fix ERR constant to match standard curses (-1 instead of 1)
- Fix unctrl() return type annotation (str instead of int)
…ified keys

Add support for:
- SS3 format arrow keys (ESC O A/B/C/D) for application cursor mode
- SS3 navigation keys (Home, End, keypad Enter)
- Shift+Tab (ESC [ Z -> KEY_BTAB)
- Parameterized sequences with modifiers (ESC [ n ; m X)
- Shifted key variants (Shift+Arrow, Shift+Delete, etc.)
- Windows Shift+Tab (scan code 15)

These sequences are sent by terminals in application mode (tmux, screen,
vim, etc.) and were previously unrecognized, causing arrow keys and
Shift+Tab to not work.
- Rewrite Unix key input to use non-blocking I/O via fcntl
- Fix key repeat/hold by reading Python's buffer before select()
- Add SIGWINCH handler for window resize detection
- Implement cursor APIs: clear, clrtoeol, clrtobot, clearok, timeout
- Return KEY_RESIZE on terminal resize events
Use true-color (24-bit) ANSI sequences for colors defined with
init_color(). Previously, custom RGB values stored in color_table
were ignored during rendering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli / tui Something related to the CLI dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows object has no attribute '_win' do you mean mvwin?

1 participant