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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/trino-cli/src/main/java/io/trino/cli/InputReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import static org.jline.reader.LineReader.BLINK_MATCHING_PAREN;
import static org.jline.reader.LineReader.HISTORY_FILE;
import static org.jline.reader.LineReader.MAIN;
import static org.jline.reader.LineReader.Option.HISTORY_IGNORE_SPACE;
import static org.jline.reader.LineReader.Option.HISTORY_TIMESTAMPED;
import static org.jline.reader.LineReader.SECONDARY_PROMPT_PATTERN;
import static org.jline.utils.AttributedStyle.BRIGHT;
Expand All @@ -49,6 +50,7 @@ public InputReader(ClientOptions.EditingMode editingMode, Path historyFile, bool
.variable(HISTORY_FILE, historyFile)
.variable(SECONDARY_PROMPT_PATTERN, isRealTerminal() ? colored("%P -> ") : "") // workaround for https://github.com/jline/jline3/issues/751
.variable(BLINK_MATCHING_PAREN, 0)
.option(HISTORY_IGNORE_SPACE, false) // store history even if the query starts with spaces
.parser(new InputParser())
.highlighter(new InputHighlighter())
.completer(new AggregateCompleter(completers))
Expand Down