Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
fix: makes the max terminal width for tables correct on Windows machi…
Browse files Browse the repository at this point in the history
…nes (#386)
  • Loading branch information
RodEsp authored Jul 7, 2021
1 parent 94d7f95 commit 4e5c19b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/styled/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class Table<T extends object> {
col.width = col.maxWidth!
}
// terminal width
const maxWidth = stdtermwidth
const maxWidth = stdtermwidth - 2
// truncation logic
const shouldShorten = () => {
// don't shorten if full mode
Expand Down Expand Up @@ -259,7 +259,7 @@ class Table<T extends object> {
// print header dividers
let dividers = options.rowStart
for (const col of columns) {
const divider = ''.padEnd(col.maxWidth! - 1, '─') + ' '
const divider = ''.padEnd(col.width! - 1, '─') + ' '
dividers += divider.padEnd(col.width!)
}
options.printLine(chalk.bold(dividers))
Expand Down

0 comments on commit 4e5c19b

Please sign in to comment.