Skip to content

Accept common key chord notations - #165

Merged
schickling merged 1 commit into
mainfrom
schickling/2026-08-15-pty-send
Aug 15, 2026
Merged

Accept common key chord notations#165
schickling merged 1 commit into
mainfrom
schickling/2026-08-15-pty-send

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Problem

pty send --seq key:<name> accepted only + modifier separators. Common spellings such as ctrl-u, ctrl_u, and readline/tmux-style C-u failed with diagnostics that did not show a valid form.

Goal

Accept familiar, unambiguous key-chord notation across CLI, client, and testing surfaces, while preserving whole-sequence pre-send validation and making invalid input self-correcting.

Decisions

  • Accept +, -, and _ between full modifier names; accept leading C- as the only compact modifier alias.
  • Keep M-, S-, and C+ invalid rather than assigning surprising meanings.
  • Reject a separator-bearing spelling as ambiguous only when it is both an exact named key and a valid modifier chord.
  • Keep validation before connection/delivery so an invalid later --seq item cannot send an earlier prefix.
  • Add VRS requirement R13 and the corresponding parser flow, notation table, and executable ownership mapping.

Verification

  • npm run build - passed.
  • npm run typecheck - passed.
  • npm test -- --run tests/keys.test.ts tests/help.test.ts tests/send-paste.test.ts - 3 files, 67 tests passed.
  • node scripts/verify-docs.ts --vrs-only - verified 2 VRS documents and 13 requirement IDs.
  • Built-CLI e2e against an isolated registry:
    • ctrl+u, ctrl-u, ctrl_u, and C-u delivered four 0x15 bytes.
    • --seq PARTIAL --seq key:ctrl- --seq AFTER exited 1; the receiver remained unchanged, proving atomic pre-send rejection.
  • Broader npm test result: 1,609 passed, 21 skipped, 3 failed. All three failures are existing Vim/Nano screenshot environment failures reporting Incomplete terminfo entry; no changed-path test failed.
  • Full executable-doc run: 12 examples passed and the existing Vim example timed out in the same terminal environment; VRS-only verification passed.

Complexity

Small parser normalization helpers and no new dependency or module boundary.

Concerns

Future named keys containing modifier separators intentionally fail only if the same spelling also forms a valid chord. The compact alias remains deliberately limited to Control.

Friction & bottlenecks

The local terminal environment points TERMINFO at a terminal-specific database while PTY fixtures launch xterm-256color; this caused the unrelated Vim/Nano full-suite failures above. No performance bottleneck was encountered.

Follow-ups

None.

References

Closes #164.

@schickling
schickling marked this pull request as ready for review August 15, 2026 09:15
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@schickling
schickling merged commit 3a403f0 into main Aug 15, 2026
2 checks passed
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.

pty send: key specs accept only ctrl+x; ctrl-u and C-u are rejected, and the error names no valid keys

2 participants