Skip to content

cli/sql: trigger history search by typing a prefix + up arrow #21825

@andreimatei

Description

@andreimatei

I want the history search to be activated when I press the up arrow after typing a statement prefix. The search should be initialized with that prefix. So, if I type "alt" then up arrow, I want to search for the last statement that started with "alt". And then up arrow and down arrow would cycle through commands with that prefix.

You get that in bash with this:

bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'

I think it's inspired by Matlab's console, and it's so good! I never want to use a terminal without it again.

Jira issue: CRDB-5874

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cli-clientCLI commands that pertain to using SQL featuresC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)X-staleno-issue-activity

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions