Skip to content

cli/sql: history-search result is messed up by line navigation #21826

@andreimatei

Description

@andreimatei

At the prompt, press Ctrl+R to get the history search, then type something to get a result:

root@:26257/t> alter table s add constraint b_unique unique (b);                                                                                                                   bck:alte

Now, I like my result but I want to edit it, so I press right arrow. At this point, the result is messed up because the characters [C show up at the beginning of the line. Escape sequence gone wrong?
This is with iterm2.

After pressing the right arrow, the line looks like this:

root@:26257/t> [Calter table s add constraint b_unique unique (b);

If you poke into the history code to fix this and you also do #21825 for me, you get my peer ack :P

Jira issue: CRDB-5873

Epic CRDB-22182

Metadata

Metadata

Assignees

Labels

A-cli-clientCLI commands that pertain to using SQL featuresC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions