Skip to content

Commit 348646e

Browse files
CHANGE: @W-20005455@: Remove table borders (#1920)
1 parent fdfc48c commit 348646e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/lib/Display.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,17 @@ export class UxDisplay implements Display {
7575
}
7676

7777
public displayTable<R extends Record<string, unknown>>(options: TableOptions<R>): void {
78-
this.displayable.table(options);
78+
// Unfortunately the table options borderStyle and noStyle don't do anything because
79+
// I believe sfCommand always overrides them or something. But the environment variable
80+
// SF_TABLE_BORDER_STYLE still seems to work so we'll use this to prevent adding border lines
81+
// which make large overflowing tables look ugly. This seems to look good:
82+
const original_SF_TABLE_BORDER_STYLE = process.env.SF_TABLE_BORDER_STYLE;
83+
process.env.SF_TABLE_BORDER_STYLE = 'headers-only-with-underline';
84+
try {
85+
this.displayable.table(options);
86+
} finally {
87+
process.env.SF_TABLE_BORDER_STYLE = original_SF_TABLE_BORDER_STYLE;
88+
}
7989
}
8090

8191
public confirm(message: string): Promise<boolean> {

0 commit comments

Comments
 (0)