From 82404936859035fbf7e2a47e8af71a2f119ad312 Mon Sep 17 00:00:00 2001 From: Hualet Wang Date: Thu, 28 Aug 2025 16:52:06 +0800 Subject: [PATCH] fix: not using system default terminal on deepin (#9527) * fix: not using system default terminal on deepin deepin-terminal is not in the `linuxTerminals` list, that will cause xterm picked as the terminal to run code tool, which has compatibility with Chinese charaters. see: https://bbs.deepin.org.cn/post/290948 Signed-off-by: Hualet Wang * feat(codetool): add support for deepin-terminal --------- Signed-off-by: Hualet Wang Co-authored-by: GeorgeDong32 --- src/main/services/CodeToolsService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/services/CodeToolsService.ts b/src/main/services/CodeToolsService.ts index 6cc8a41b05..256b4dcbd6 100644 --- a/src/main/services/CodeToolsService.ts +++ b/src/main/services/CodeToolsService.ts @@ -421,7 +421,7 @@ end tell` const envPrefix = buildEnvPrefix(false) const command = envPrefix ? `${envPrefix} && ${baseCommand}` : baseCommand - const linuxTerminals = ['gnome-terminal', 'konsole', 'xterm', 'x-terminal-emulator'] + const linuxTerminals = ['gnome-terminal', 'konsole', 'deepin-terminal', 'xterm', 'x-terminal-emulator'] let foundTerminal = 'xterm' // Default to xterm for (const terminal of linuxTerminals) { @@ -448,6 +448,9 @@ end tell` } else if (foundTerminal === 'konsole') { terminalCommand = 'konsole' terminalArgs = ['--workdir', directory, '-e', 'bash', '-c', `clear && ${command}; exec bash`] + } else if (foundTerminal === 'deepin-terminal') { + terminalCommand = 'deepin-terminal' + terminalArgs = ['-w', directory, '-e', 'bash', '-c', `clear && ${command}; exec bash`] } else { // Default to xterm terminalCommand = 'xterm'