Skip to content

Commit

Permalink
Store CLI history even if query starts with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Jun 21, 2022
1 parent e5c5ff6 commit 058904c
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 058904c

Please sign in to comment.