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 <mr.asianwang@gmail.com>

* feat(codetool): add support for deepin-terminal

---------

Signed-off-by: Hualet Wang <mr.asianwang@gmail.com>
Co-authored-by: GeorgeDong32 <GeorgeDong32@qq.com>
This commit is contained in:
Hualet Wang 2025-08-28 16:52:06 +08:00 committed by GitHub
parent f95b9cef77
commit 8240493685
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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'