Skip to content

Fix double escape#648

Merged
kommander merged 2 commits intoanomalyco:mainfrom
simonklee:fix-double-escape
Feb 8, 2026
Merged

Fix double escape#648
kommander merged 2 commits intoanomalyco:mainfrom
simonklee:fix-double-escape

Conversation

@simonklee
Copy link
Collaborator

@simonklee simonklee commented Feb 8, 2026

Recognize ESC ESC prefix sequences (e.g. Option+Arrow keys in iTerm2) by
recursively checking completeness after stripping the leading ESC. When
buffering incomplete input, emit a bare ESC ESC as its own sequence unless
followed by a valid nested escape introducer like [, O, etc.

Fix #644

Regression tests for anomalyco#644 where Option+Arrow on macOS (e.g. \x1b\x1b[D)
was incorrectly split into meta+escape and literal characters.
Recognize ESC ESC prefix sequences (e.g. Option+Arrow keys in iTerm2) by
recursively checking completeness after stripping the leading ESC. When
buffering incomplete input, emit a bare ESC ESC as its own sequence unless
followed by a valid nested escape introducer like `[`, `O`, etc.
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 8, 2026

@opentui/core

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core@648

@opentui/react

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/react@648

@opentui/solid

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/solid@648

@opentui/core-darwin-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-arm64@648

@opentui/core-darwin-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-darwin-x64@648

@opentui/core-linux-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-arm64@648

@opentui/core-linux-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-linux-x64@648

@opentui/core-win32-arm64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-arm64@648

@opentui/core-win32-x64

npm i https://pkg.pr.new/anomalyco/opentui/@opentui/core-win32-x64@648

commit: eb1fc02

@kommander kommander merged commit e5ed449 into anomalyco:main Feb 8, 2026
11 of 13 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.

stdin-buffer incorrectly splits double-escape sequences (Option+Arrow on macOS)

2 participants