Skip to content
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

Store CLI history even if query starts with spaces #12847

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Jun 15, 2022

Description

Previously, query starting with spaces likes below wasn't stored to history.

trino>     SELECT 1;

Documentation

(x) No documentation is needed.

Release notes

(x) Release notes entries required with the following suggested text:

# CLI
* Store history even if query starts with spaces. ({issue}`12847`)

@cla-bot cla-bot bot added the cla-signed label Jun 15, 2022
@ebyhr ebyhr requested a review from electrum June 15, 2022 04:09
Copy link
Member

@nineinchnick nineinchnick left a comment

Choose a reason for hiding this comment

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

That's the default behavior of bash, but I guess cli users don't have to know it and can be pasting queries with extra chars

@findepi
Copy link
Member

findepi commented Jun 15, 2022

That's the default behavior of bash

i find it very useful to be able to skip history, especially when i rely on my history to fire up queries effectively.

but I guess cli users don't have to know it

if a user is unaware of history, it doesn't matter
it they know about arrow up/down and nothing more, the change makes sense
if they want to leverage history more, like ctrl+R, i guess it may be negative.

(just my 2c)

@martint
Copy link
Member

martint commented Jun 17, 2022

Why would history not be saved if the line has leading spaces? I think that's a UI inconsistency and usability issue. In particular, is seems wrong that one of these lines will get saved but the other one won't:

trino> SELECT 1;
trino>  SELECT 2;

I consider that a bug.

@ebyhr ebyhr merged commit 058904c into trinodb:master Jun 21, 2022
@ebyhr ebyhr deleted the ebi/cli-history-space branch June 21, 2022 02:01
@ebyhr ebyhr mentioned this pull request Jun 21, 2022
@github-actions github-actions bot added this to the 387 milestone Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants