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

Commit 4e5c19b

Browse files
authored
fix: makes the max terminal width for tables correct on Windows machines (#386)
1 parent 94d7f95 commit 4e5c19b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/styled/table.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class Table<T extends object> {
198198
col.width = col.maxWidth!
199199
}
200200
// terminal width
201-
const maxWidth = stdtermwidth
201+
const maxWidth = stdtermwidth - 2
202202
// truncation logic
203203
const shouldShorten = () => {
204204
// don't shorten if full mode
@@ -259,7 +259,7 @@ class Table<T extends object> {
259259
// print header dividers
260260
let dividers = options.rowStart
261261
for (const col of columns) {
262-
const divider = ''.padEnd(col.maxWidth! - 1, '─') + ' '
262+
const divider = ''.padEnd(col.width! - 1, '─') + ' '
263263
dividers += divider.padEnd(col.width!)
264264
}
265265
options.printLine(chalk.bold(dividers))

0 commit comments

Comments
 (0)