Skip to content

Handle Ctrl-Z in incremental history search through the key binding - #45

Merged
alexey-milovidov merged 1 commit into
masterfrom
clickhouse/no-suspend-in-history-search-master
Oct 12, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
clickhouse/no-suspend-in-history-search-master

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

The incremental history search (Ctrl-R / Ctrl-S) handled Ctrl-Z itself with raise( SIGSTOP ), bypassing the key binding. An application that rebinds Ctrl-Z to disable suspending still had the process stopped when the key was pressed during a search. In ClickHouse, the line editor runs inside the server process for client sessions embedded into the server (the web terminal and SSH), so Ctrl-R then Ctrl-Z stopped the whole server.

Now Ctrl-Z leaves the search and goes to the main loop, like the other editing keys, so it goes through the key binding. With the default binding it still suspends, through the suspend action. That action is now the only raise call, and it can only be reached through the binding.

ClickHouse PR: ClickHouse/ClickHouse#125512

ClickHouse currently uses this change on top of the clickhouse/history-recalled-hints-fix branch (commit 00cd994, branch clickhouse/no-suspend-in-history-search). This PR has the same change cherry-picked onto master.

🤖 Generated with Claude Code

The incremental history search had its own handling of Ctrl-Z with
`raise( SIGSTOP )`, bypassing the key binding. When an application rebinds
Ctrl-Z to disable suspending (e.g. when the line editor runs inside a server
process serving a pseudoterminal), the search still stopped the process.

Now Ctrl-Z leaves the search and is passed to the main loop, like other
editing keys, so that it goes through the key binding.

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 12, 2026
@alexey-milovidov
alexey-milovidov merged commit 91703bf into master Oct 12, 2026
1 check failed
alexey-milovidov added a commit to ClickHouse/ClickHouse that referenced this pull request Oct 12, 2026
`master` of `replxx` now contains the fix of Ctrl-Z in the incremental history
search. The new commit merges it with the history recall changes used by
ClickHouse and fixes Ctrl-V blocking after the esc delay support from `master`.

Related: ClickHouse/replxx#45
Related: ClickHouse/replxx#46

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