Skip to content

Fix Meta with escape sequences (e.g. Meta+Up) - #48

Merged
alexey-milovidov merged 1 commit into
masterfrom
clickhouse/fix-meta-escape-sequence
Oct 13, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
clickhouse/fix-meta-escape-sequence

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Terminals send Meta+key as ESC followed by the key, so Meta+Up is ESC ESC [ A.

Since the esc delay support (ef93b95), setMetaRoutine parses the escape sequence after the second ESC with escRoutine, but discards the result and then dispatches the second ESC again. As a result, Meta+Up and other Meta+special-key combinations are not recognized, and the rest of the sequence is misinterpreted.

This returns the result of escRoutine, as before. When an esc delay is set and runs out after the second ESC, escRoutine still returns ESC.

This made the ClickHouse test 04909_client_hints_history_navigation (case meta_up_recall_no_hints) fail in every stateless test job of ClickHouse/ClickHouse#125510, which pins replxx master:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125510&sha=33773832dc78e5a5e773171f8b489ca21d9bd77a&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29

With this change, the test passes locally, as do the other interactive client tests.

🤖 Generated with Claude Code

Terminals send Meta+key as ESC followed by the key, so Meta+Up is `ESC ESC [ A`.
Since the esc delay support, `setMetaRoutine` parsed the escape sequence after
the second ESC with `escRoutine` but discarded the result, and then dispatched
the second ESC again: Meta+Up and other Meta+special-key combinations were not
recognized, and the rest of the sequence was misinterpreted.

Return the result of `escRoutine`, as it was before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexey-milovidov added a commit to ClickHouse/ClickHouse that referenced this pull request Oct 13, 2026
The previous `replxx` commit had a regression from the esc delay support in
`replxx` `master`: Meta with escape sequences (e.g. Meta+Up) was not recognized,
and `04909_client_hints_history_navigation` (`meta_up_recall_no_hints`) failed in
every stateless test job:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=125510&sha=33773832dc78e5a5e773171f8b489ca21d9bd77a&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
#125510

The new commit is current `replxx` `master` (which also has the UTF-8 decoder
state kept per `Terminal` from ClickHouse/replxx#47)
plus the fix.

Related: ClickHouse/replxx#48

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexey-milovidov added a commit to spinojara/ClickHouse that referenced this pull request Oct 13, 2026
The previous `replxx` commit had a regression from the esc delay support: Meta
with escape sequences (e.g. Meta+Up) was not recognized, which breaks
`04909_client_hints_history_navigation` (`meta_up_recall_no_hints`). The new
commit is current `replxx` `master` plus the fix.

Related: ClickHouse/replxx#48

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@alexey-milovidov alexey-milovidov self-assigned this Oct 13, 2026
@alexey-milovidov
alexey-milovidov merged commit dd595df into master Oct 13, 2026
1 check failed
alexey-milovidov added a commit to spinojara/ClickHouse that referenced this pull request Oct 13, 2026
Points the submodule to the merge commit of ClickHouse/replxx#48 on `master`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexey-milovidov added a commit to ClickHouse/ClickHouse that referenced this pull request Oct 13, 2026
The same tree as the previous `replxx` commit, now merged into `replxx` `master`
via ClickHouse/replxx#48.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant