Skip to content

Commit 925cc87

Browse files
committed
fix: add extra space for emoji rendering in Windows Terminal
closes #938
1 parent b93db6d commit 925cc87

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/utils/logger.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,16 @@ export function createLogger(
7676
allowClearScreen && process.stdout.isTTY && !process.env.CI
7777
const clear = canClearScreen ? clearScreen : () => {}
7878

79+
// extra space for rendering emoji correctly on Windows Terminal
80+
const isWindowsTerminal = !!process.env.WT_SESSION
81+
const emojiDivier = ' '.repeat(isWindowsTerminal ? 2 : 1)
82+
7983
const logger: Logger = {
8084
level,
8185
options: resolvedOptions,
8286

8387
info(...msgs: any[]): void {
84-
output('info', `${blue`ℹ`} ${format(msgs)}`)
88+
output('info', `${blue`ℹ`}${emojiDivier}${format(msgs)}`)
8589
},
8690

8791
warn(...msgs: any[]): void {
@@ -113,7 +117,7 @@ export function createLogger(
113117
},
114118

115119
success(...msgs: any[]): void {
116-
output('info', `${green`✔`} ${format(msgs)}`)
120+
output('info', `${green`✔`}${emojiDivier}${format(msgs)}`)
117121
},
118122

119123
clearScreen(type) {

0 commit comments

Comments
 (0)