Skip to content

Commit

Permalink
Merge pull request #9 from tscpp/support-stable-apis
Browse files Browse the repository at this point in the history
  • Loading branch information
eliassjogreen authored Jul 30, 2021
2 parents 89bfef4 + c76209b commit e9c1482
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,14 @@ export class Spinner {
}

updateLines(): void {
const columns = Deno.consoleSize(this.#stream.rid)?.columns || 80;
let columns = 80;

try {
columns = Deno.consoleSize(this.#stream.rid)?.columns ?? columns;
} catch {
// Unstable APIs is not enabled, fallback to default
}

const fullPrefixText = typeof this.prefix === "string"
? this.prefix + "-"
: "";
Expand Down

0 comments on commit e9c1482

Please sign in to comment.