Skip to content

Replace curses with pure-Python terminal I/O - #37

Merged
jserv merged 1 commit into
mainfrom
no-curses
Feb 18, 2026
Merged

jserv merged 1 commit into
mainfrom
no-curses

Conversation

@jserv

@jserv jserv commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

'menuconfig' now uses a pure-Python terminal module that provides direct terminal control via termios (Unix) and Win32 console API (Windows), eliminating the curses/windows-curses dependency entirely.

  • Add rawterm.py: pure-Python terminal I/O (Color, Style, Region, Terminal, Key, Box) with three Windows input paths (VT100, ReadConsoleInputW, MSYS2/mintty PTY)
  • Rewrite menuconfig.py to use rawterm API instead of curses
  • Fix RTEE border style mismatch in separator lines
  • Normalize CR to LF in rawterm input (all three paths) so Enter works consistently across Unix and Windows

Summary by cubic

Replaced curses with a pure-Python terminal I/O layer for menuconfig, removing the windows-curses dependency and unifying behavior across Unix and Windows. Adds cross-platform CI validation and improves input handling reliability.

  • New Features

    • Added rawterm.py (Color, Style, Region, Terminal, Key, Box) with Windows input paths (VT100, ReadConsoleInputW, MSYS2/mintty PTY); normalized Enter handling (CR→LF) and fixed RTEE border style.
    • Rewrote menuconfig to use rawterm.
    • Added .ci/validate-rawterm.py; CI runs it on Unix and on Windows via cmd to use native console handles.
  • Bug Fixes

    • Fixed Color.repr to show named colors correctly.
    • Fixed escape sequence dead-end input loss via a _pending_key buffer.

Written for commit 56894d8. Summary will update on new commits.

cubic-dev-ai[bot]

This comment was marked as resolved.

menuconfig now uses rawterm, a pure-Python terminal module that
provides direct terminal control via termios (Unix) and Win32
console API (Windows), eliminating the curses/windows-curses
dependency entirely.

Key changes:
- Add rawterm.py: pure-Python terminal I/O (Color, Style, Region,
  Terminal, Key, Box) with three Windows input paths (VT100,
  ReadConsoleInputW, MSYS2/mintty PTY)
- Rewrite menuconfig.py to use rawterm API instead of curses
- Fix RTEE border style mismatch in separator lines
- Normalize CR to LF in rawterm input (all three paths) so Enter
  works consistently across Unix and Windows
- Fix Color.__repr__ for named colors (Color.RED not Color.index(1))
- Fix escape sequence dead-end input loss via _pending_key buffer
- Add rawterm to setup.py py_modules for pip install
- Add .ci/validate-rawterm.py for CI validation with Windows
  console probing via ctypes
- Update CI workflow: split validation into Unix/Windows steps
  with cmd shell on Windows for real console handles
- Update README.md, kconfiglib.py, setup.py to remove curses refs
@jserv
jserv merged commit 7266e63 into main Feb 18, 2026
9 checks passed
@jserv
jserv deleted the no-curses branch February 18, 2026 17:38
@eastWillow

Copy link
Copy Markdown

Works on Windows 11 Home (Build 26100.7623) using cmd.exe. No UI regressions or rendering issues found.
image

PowerShell with Windows Terminal Works as Expected.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants