fix(CodeToolsService): open new terminal tab for command execution (#9610)

Updated the terminal command execution logic to open a new tab in the Terminal application for running commands. This change enhances user experience by keeping the original tab available while executing commands in a separate tab.
This commit is contained in:
beyondkmp 2025-08-28 09:24:15 +08:00 committed by GitHub
parent 7407bb335d
commit 69252f6177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -337,8 +337,9 @@ class CodeToolsService {
terminalArgs = [
'-e',
`tell application "Terminal"
set newTab to do script "cd '${directory.replace(/'/g, "\\'")}' && clear"
activate
do script "cd '${directory.replace(/'/g, "\\'")}' && clear && ${command.replace(/"/g, '\\"')}"
do script "${command.replace(/"/g, '\\"')}" in newTab
end tell`
]
break