From 6f8d975fe7a9074febcb00fd5474f3928f6ec49d Mon Sep 17 00:00:00 2001 From: NaviElLay <43141188+daailouivan@users.noreply.github.com> Date: Thu, 10 Sep 2026 08:56:23 +0000 Subject: [PATCH] fix(desktop): use valid LC_CTYPE on Linux terminals --- apps/desktop/electron/terminal-ipc.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/desktop/electron/terminal-ipc.ts b/apps/desktop/electron/terminal-ipc.ts index 9dc7e2851f..8a4eb61118 100644 --- a/apps/desktop/electron/terminal-ipc.ts +++ b/apps/desktop/electron/terminal-ipc.ts @@ -156,7 +156,10 @@ export function registerTerminalIpc({ delete env.COLORFGBG env.COLORTERM = 'truecolor' - env.LC_CTYPE = env.LC_CTYPE || 'UTF-8' + // macOS accepts the bare charset name "UTF-8"; glibc does not, and bash + // warns: setlocale: LC_CTYPE: cannot change locale (UTF-8). Prefer LANG or C.UTF-8 on Linux. + env.LC_CTYPE = + env.LC_CTYPE || (process.platform === 'darwin' ? 'UTF-8' : env.LANG || 'C.UTF-8') env.TERM = 'xterm-256color' env.TERM_PROGRAM = 'Hermes' env.TERM_PROGRAM_VERSION = app.getVersion()