Skip to content

fix(terminal): support Linux system terminal launchers - #9987

Merged
farion1231 merged 1 commit into
farion1231:mainfrom
liusheng2020:fix/linux-default-terminal-fallback
Nov 26, 2026
Merged

farion1231 merged 1 commit into
farion1231:mainfrom
liusheng2020:fix/linux-default-terminal-fallback

Conversation

@liusheng2020

Copy link
Copy Markdown
Contributor

Human Note / 本人说明

我发现我的 Linux 环境中有 /usr/bin/x-terminal-emulator 和 /usr/bin/xdg-terminal-exec,但 CC Switch 的终端列表没有尝试它们。这个 PR 把这两个系统入口加入 Linux 终端回退列表,并让“打开终端”和运行脚本的入口共用同一列表。

I found /usr/bin/x-terminal-emulator and /usr/bin/xdg-terminal-exec in my Linux environment, but CC Switch did not try them. This PR adds both system launchers to the Linux fallback list and shares the same list between the provider terminal and script-launch paths.

Summary / 概述

  • Add x-terminal-emulator -e and xdg-terminal-exec -- to the Linux fallback candidates.
  • Keep a configured preferred terminal first.
  • Reuse the candidate list for both Linux terminal launch paths.
  • Add a regression test for the new candidates and preference ordering.

Related Issue / 关联 Issue

Fixes #9986

Screenshots / 截图

Not applicable.

Checklist / 检查清单

  • pnpm typecheck passes / 通过 TypeScript 类型检查
  • pnpm format:check passes / 通过代码格式检查
  • cargo fmt --check passes / 通过 Rust 格式检查
  • cargo clippy --all-targets -- -D warnings passes / 通过 Clippy 检查
  • cargo test --lib commands::terminal_launch::tests passes / 终端启动模块单测通过
  • Updated i18n files if user-facing text changed / 未修改用户可见文本

@farion1231 farion1231 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,感谢您的贡献!

@farion1231
farion1231 merged commit 51657ff into farion1231:main Nov 26, 2026
11 checks passed
@farion1231

Copy link
Copy Markdown
Owner

已合并,感谢您的贡献!把 x-terminal-emulator 和 xdg-terminal-exec 加进 Linux 终端回退列表,并让两个启动入口共用同一份列表,修复了 #9986,以后维护也只改一处。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend (Rust/Tauri)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Linux terminal launch ignores system default terminal launchers

2 participants