Skip to content

Commit

Permalink
Re-enable harcdoded prompt sizing for windows (com-lihaoyi#4059)
Browse files Browse the repository at this point in the history
Was meant to land in com-lihaoyi#4053 but
got lost in the merge

This hardcoding is just a hack until
com-lihaoyi#4055 is resolved
  • Loading branch information
lihaoyi authored and jodersky committed Jan 14, 2025
1 parent b42c253 commit 1c95e36
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions runner/client/src/mill/runner/client/MillProcessLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,19 @@ static int getTerminalDim(String s, boolean inheritError) throws Exception {

static void writeTerminalDims(boolean tputExists, Path serverDir) throws Exception {
String str;
if (!tputExists) str = "0 0";
else {
try {
if (java.lang.System.console() == null) str = "0 0";
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 (!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";
}
Files.write(serverDir.resolve(ServerFiles.terminfo), str.getBytes());
}
Expand Down

0 comments on commit 1c95e36

Please sign in to comment.