Skip to content

Commit

Permalink
Fix cr/lf
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 23, 2023
1 parent 8805647 commit a054396
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,11 +633,6 @@ public String readLine(String prompt, String rightPrompt, MaskingCallback maskin
if (isSet(Option.AUTO_FRESH_LINE)) callWidget(FRESH_LINE);
if (isSet(Option.MOUSE)) terminal.trackMouse(Terminal.MouseTracking.Normal);
if (isSet(Option.BRACKETED_PASTE)) terminal.writer().write(BRACKETED_PASTE_ON);
} else {
// For dumb terminals, we need to make sure that CR are ignored
Attributes attr = new Attributes(originalAttributes);
attr.setInputFlag(Attributes.InputFlag.IGNCR, true);
terminal.setAttributes(attr);
}

callWidget(CALLBACK_INIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ private Terminal doBuild() throws IOException {
type = getDumbTerminalType(dumb, systemStream);
terminal = new DumbTerminalProvider()
.sysTerminal(name, type, false, encoding, nativeSignals, signalHandler, paused, systemStream);
if (OSUtils.IS_WINDOWS) {
Attributes attr = terminal.getAttributes();
attr.setInputFlag(Attributes.InputFlag.IGNCR, true);
terminal.setAttributes(attributes);
}
}
} else {
for (TerminalProvider provider : providers) {
Expand Down

0 comments on commit a054396

Please sign in to comment.