The Cygwin runtime reads and adjusts its token through ntdll. Both take the
arguments of their advapi32 forms (GetTokenInformation,
AdjustTokenPrivileges), run those, and answer the NTSTATUS of the error:
STATUS_BUFFER_TOO_SMALL for a short buffer, STATUS_NOT_ALL_ASSIGNED when the
token lacks some of the privileges.
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: the two token functions
(cherry picked from commit 86b1f72ba9f5c52363664969d7cb5e019b4c35a0)
* feat: give console programs the terminal as their console
A standard handle that is a terminal, and CONIN$, CONOUT$ and CON, now act as a console: modes map to terminal settings,
reads and writes convert between UTF-16 and the terminal's UTF-8, terminal input becomes key events, and Ctrl+C runs the
control handlers. Files and pipes still fail the console functions, as on Windows.
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: Wrote the console functions over the terminal, their pty test and the guest test program from the public console API documentation.
* test: let the console client run by hand, saying which step failed
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: Made the exact size and cursor checks optional and gave each step an instruction and a failure number.
* feat: follow the console cursor through the output instead of asking the terminal
Programs that redraw their command line read and move the cursor on every key; asking the terminal each time was slow, and
wrong on terminals that never answer. The terminal is now asked only when the position may be stale.
Assisted-by: Claude Code:claude-opus-5-5
AI-Scope: Wrote the cursor tracker, WriteConsoleOutputCharacter, ScrollConsoleScreenBuffer, the resize events and their tests.