-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli/sql: history-search result is messed up by line navigation #21826
Comments
I'll blame the terminal. This never happens to me. Have you tried with apple's regular terminal? Also there's no special code in the current implementation to do this. The escape sequences to clear the line, move the cursor home, redraw the prompt, are all sent without any complication from the terminfo/termcap spec to the terminal. I'm wary to 1) spend hours to figure how your terminal diverges from expectations 2) bake a custom fix into some arbitrary fork of libedit (presumably we need to find the copy they use for osx, who knows what other osx-specific code there's in there) 3) vendor that 4) deal with the fallout when our vendored version becomes out of sync with whatever fixes needed upstream when folk upgrade their osx release. So yeah, no. I'll leave the issue open until this can be further qualified, but I will certainly not work on it myself. |
Happens to me with OSX's Terminal app too. It doesn't happen on a Linux term? Just in case this is news and rings a bell, Can I get another another person to confirm that this happens on iTerm2 and it's not just me - maybe I have a weird key binding in some config somewhere. @tschottdorf would you mind? |
Happens to me too, in both. |
@andreimatei I found a workaround for Terminal.app
|
we'll look into it during cli bug fixit day |
Claim that bounty!
…On Fri, Jul 20, 2018, 9:31 AM kena ***@***.***> wrote:
we'll look into it during cli bug fixit day
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21826 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAXBcTJZseGo_NxTyC2SQzNeRnW4bIDqks5uIYdUgaJpZM4RutNh>
.
|
ok I found the bug, it's in upstream. While the history search mode is activated, the thing only recognizes regular key presses. an escape sequence like an arrow key is handled as an ESC key followed by |
The proper behavior can be obtained like this:
|
oh wow no "enter" actually also runs the command. now I understand why this won't do |
Found a workaround: after finding your history entry press |
We have marked this issue as stale because it has been inactive for |
86457: cli: replace libedit with bubbline r=ZhouXing19 a=knz First commit from #88574. Benefits from (but is not dependent on) #87606 server-side. Fixes #21826 Fixes #71207 Fixes #71209 Fixes #57885 NB: this will benefit from upstream library releases based off the still-unmerged PRs listed in knz/bubbline#2. Release justification: n/a will not merge before stability ends Release note (cli change): The engine used as line editor in the interactive shell (`cockroach sql`, `demo`) has been updated. It includes numerous bug fixes and new features. The previous engine can still be accessed via the env var COCKROACH_SQL_FORCE_LIBEDIT. This support will be removed in a later version. 92335: kvserver,logstore: introduce log StateLoader r=tbg a=pavelkalinnikov Previously the `StateLoader` accessed both log and state machine state. This commit moves most of the log-specific accesstors to the `logstore` package. Part of #91979 Release note: None Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net> Co-authored-by: Pavel Kalinnikov <pavel@cockroachlabs.com>
At the prompt, press Ctrl+R to get the history search, then type something to get a result:
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:
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
The text was updated successfully, but these errors were encountered: