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

Fix cr/lf support in dumb terminals #877

Merged
merged 1 commit into from
Oct 24, 2023
Merged
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
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(attr);
}
}
} else {
for (TerminalProvider provider : providers) {
Expand Down
Loading