Skip to content
Open
Show file tree
Hide file tree
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: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ netty = "4.2.10.Final"
javapoet = "1.13.0"
javax = "1.3.2"
jetbrainsAnnotations = "26.0.2-1"
jline = "3.29.0"
jline = "4.0.0"
jmh = "1.37"
junit5 = "5.14.3"
junit5-platform = "1.14.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ public JlineQuestionWriterReader(LineReader reader) {
@Override
public String readAnswer(String question, boolean maskInput) {
try {
MaskingCallback callback = maskInput ? new SimpleMaskingCallback('*') : null;
// Masking callback triggers jline's "mask thread" on dumb terminals, which repeatedly
// writes clearing sequences to the terminal output. On dumb terminals with 0x0 size,
// the mask thread is never stopped (doCleanup skips stopMaskThread), causing test
// failures and disruptive output on real dumb terminals. Since display operations are
// no-ops on 0x0 terminals anyway, skipping the masking callback on dumb terminals
// preserves the same visual behavior as jline 3.
boolean dumb = "dumb".equals(reader.getTerminal().getType())
|| "dumb-color".equals(reader.getTerminal().getType());
MaskingCallback callback = (maskInput && !dumb) ? new SimpleMaskingCallback('*') : null;
return reader.readLine(question, null, callback, null);
} catch (UserInterruptException /* Ctrl-C pressed */ | EndOfFileException /* Ctrl-D pressed */ ignored) {
throw new FlowInterruptException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ void testCandidatesForEmptyLineDontContainExtraKeywordsOrSchema() {
List.of(""),
0,
0,
0,
"",
0,
0
),
candidates
Expand All @@ -54,7 +57,10 @@ void testCandidatesForSecondWordContainExtraKeywordsAndSchema() {
List.of("select", ""),
1,
0,
6
6,
"",
0,
0
),
candidates
);
Expand Down