Skip to content

Commit

Permalink
fix: docker runtime fail because stdout columns
Browse files Browse the repository at this point in the history
  • Loading branch information
KernelDeimos committed Jul 8, 2024
1 parent 6603c45 commit 94c0449
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/backend/src/fun/dev-console-ui-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ const surrounding_box = (col, lines, lengths) => {
lengths = lines.map(line => stringLength(line));
}

const probably_docker = (() => {
try {
// I don't know what the value of this is in Docker,
// but what I do know is it'll throw an exception
// when I do this to it.
Array(process.stdout.columns - 1);
} catch (e) {
return true;
}
})();

if ( probably_docker ) {
// We just won't try to render any decoration on Docker;
// it's not worth potentially breaking the output.
return;
}

const max_length = process.stdout.columns - 6;
// const max_length = Math.max(...lengths);

Expand Down

0 comments on commit 94c0449

Please sign in to comment.