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

1142 FLS: license assessment cli interaction is broken [2.5.0 release] #1143

Merged
merged 2 commits into from
Nov 6, 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@

import java.io.IOException;

import org.eclipse.core.runtime.Platform;

public final class ConsoleInteraction implements Interaction {

private final int stop;

public ConsoleInteraction() {
this.stop = stop();
}

@Override
public void prompt(String information) {
System.out.printf("%s\n", information); //$NON-NLS-1$
Expand All @@ -26,7 +34,7 @@ public String input() {
byte[] bytes = new byte[1024];
int length = 0;
try {
for (int symbol = System.in.read(); (symbol != 10) && (symbol != 13); symbol = System.in.read()) {
for (int symbol = System.in.read(); symbol != stop; symbol = System.in.read()) {
bytes[length++] = (byte) symbol;
}
} catch (IOException e) {
Expand All @@ -41,4 +49,11 @@ public void swear(Throwable thro) {
thro.printStackTrace(System.err);
}

private int stop() {
if (Platform.getOS().equals(Platform.OS_WIN32)) {
return 13;
eparovyshnaya marked this conversation as resolved.
Show resolved Hide resolved
}
return 10;
}

}