Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Jan 7, 2025
1 parent e16eaa0 commit 9336026
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions runner/client/src/mill/runner/client/MillProcessLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,27 +218,26 @@ static int getTerminalDim(String s, boolean inheritError) throws Exception {
static void writeTerminalDims(boolean tputExists, Path serverDir) throws Exception {
String str;

try {
if (java.lang.System.console() == null) str = "0 0";
else {
if (isWin()) {

WindowsAnsi.Size size = WindowsAnsi.terminalSize();
int width = size.getWidth();
int height = size.getHeight();
str = width + " " + height;
mill.main.client.DebugLog.println(str);
} else if (!tputExists) {
// Hardcoded size of a quarter screen terminal on 13" windows laptop
str = "78 24";
} else {
str = getTerminalDim("cols", true) + " " + getTerminalDim("lines", true);
}
}
} catch (Exception e) {
str = "0 0";
try {
if (java.lang.System.console() == null) str = "0 0";
else {
if (isWin()) {

WindowsAnsi.Size size = WindowsAnsi.terminalSize();
int width = size.getWidth();
int height = size.getHeight();
str = width + " " + height;
mill.main.client.DebugLog.println(str);
} else if (!tputExists) {
// Hardcoded size of a quarter screen terminal on 13" windows laptop
str = "78 24";
} else {
str = getTerminalDim("cols", true) + " " + getTerminalDim("lines", true);
}
}

} catch (Exception e) {
str = "0 0";
}

// We memoize previously seen values to avoid causing lots
// of upstream work if the value hasn't actually changed.
Expand Down

0 comments on commit 9336026

Please sign in to comment.