From 15465bfc5035a64762f7c86a3d38af8be6be5b59 Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Mon, 24 Jun 2024 14:01:00 -0400 Subject: [PATCH] fix: improve console experience on mac --- .../backend/src/services/DevConsoleService.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/services/DevConsoleService.js b/packages/backend/src/services/DevConsoleService.js index be0afada..c3934096 100644 --- a/packages/backend/src/services/DevConsoleService.js +++ b/packages/backend/src/services/DevConsoleService.js @@ -180,15 +180,26 @@ class DevConsoleService extends BaseService { this.generateSeparator() + `\x1B[0m\n` ); + + // Input background disabled on Mac OS because it + // has a - brace yourself - light-theme terminal 😱 + const drawInputBackground = + process.platform === 'darwin'; // Redraw the static lines this.static_lines.forEach(line => { process.stdout.write(line + '\n'); }); - process.stdout.write('\x1b[48;5;234m'); + if ( drawInputBackground ) { + // input background + process.stdout.write('\x1b[48;5;234m'); + } rl.resume(); rl._refreshLine(); - process.stdout.write('\x1b[48;5;237m'); + if ( drawInputBackground ) { + // input background + process.stdout.write('\x1b[48;5;237m'); + } }; this._redraw = () => {