Skip to content

feat(terminal): add configurable default shell#127

Merged
xintaofei merged 1 commit intoxintaofei:mainfrom
Kwensiu:feat/default-terminal-shell
Apr 29, 2026
Merged

feat(terminal): add configurable default shell#127
xintaofei merged 1 commit intoxintaofei:mainfrom
Kwensiu:feat/default-terminal-shell

Conversation

@Kwensiu
Copy link
Copy Markdown
Contributor

@Kwensiu Kwensiu commented Apr 27, 2026

概要

  • 在“设置 → 系统”中新增“默认终端”设置项
  • 从终端标签栏和文件树打开新终端时,统一使用已配置的默认终端
  • Windows 平台支持选择 PowerShell 7、Windows PowerShell 和 Command Prompt
  • 非 Windows 平台本人没有条件测试和添加,这里表示抱歉

变更说明

本次变更新增了持久化的 SystemTerminalSettings,通过 Tauri 命令和 Web API 同步暴露 default_shell 配置。

前端终端上下文会在初始化时加载默认终端配置,并订阅设置更新事件。之后通过以下入口创建的新终端标签页都会自动带上默认 shell:

  • Ctrl+J 首次打开终端面板时自动创建的终端
  • 终端标签栏的 +
  • 文件树 / 文件区域里的“在终端打开”

同时保留了底层终端创建链路对显式 shell 参数的支持,但将默认 shell 选择入口统一到“设置 → 系统”。
有考虑过使用类似 VSC 的弹窗选择启动 Shell,但是超出本次 PR 范畴没有进行添加

平台行为

Windows 可选项包括:

  • 系统默认
  • PowerShell 7 (pwsh.exe)
  • Windows PowerShell (powershell.exe)
  • Command Prompt (cmd.exe)

macOS / Linux / Server 仅提供系统默认

@Kwensiu Kwensiu force-pushed the feat/default-terminal-shell branch from ed8e0fb to 1a22de1 Compare April 27, 2026 18:10
@xintaofei
Copy link
Copy Markdown
Owner

感谢pr

@xintaofei xintaofei merged commit 882a81f into xintaofei:main Apr 29, 2026
xintaofei added a commit that referenced this pull request Apr 29, 2026
- feat(terminal): configurable default shell with backend-driven picker — `get_available_terminal_shells` / `probe_terminal_shell_path` serve the platform-aware option list, install state and `resolve_shell()` fallback; the settings UI renders the response verbatim and supports a custom shell path on every platform. POSIX spawn now distinguishes bash-family shells from unknown shells like nu/xonsh/elvish so the latter spawn cleanly without bash-only `-l -i` / `eval` flags. Localized across all 10 languages. Thanks to @Kwensiu for contributing the initial implementation in #127.
- feat(chat): file paths in Read/Write tool call headers and Edit/ApplyPatch diff headers are now clickable and open the file in the workspace panel via the existing local-file confirmation dialog; new-file Write/NotebookEdit bodies render with the same green tint as added diff lines.
- feat(chat): cap inline code block height inside messages with internal overflow scroll, so long code dumps no longer push the rest of the conversation off-screen.
- fix(dialog): constrain `DialogContent` to viewport height with internal scrolling, and cap the git reset commit message at 8rem with its own scrollbar, so the dialog footer stays visible on long messages or short viewports.

-----------------------------
# 发布版本 0.11.1

- 新增(终端):默认 Shell 改由后端驱动选择 —— `get_available_terminal_shells` / `probe_terminal_shell_path` 提供与平台相关的可选项、安装状态及 `resolve_shell()` 兜底逻辑,设置界面按后端返回原样渲染;所有平台均支持自定义 Shell 路径输入。POSIX 层在 spawn 时区分 bash 家族 Shell 与 nu/xonsh/elvish 等非 bash Shell,避免后者因 `-l -i` / `eval` 等 bash 专属参数无法启动;新增字符串已覆盖全部 10 种语言。感谢 @Kwensiu#127 中贡献初版实现。
- 新增(聊天):Read/Write 工具调用头部以及 Edit/ApplyPatch 差异头部中的文件路径现已可点击,复用既有的本地文件确认弹窗在工作区面板中打开;新文件场景下 Write/NotebookEdit 正文使用与新增差异行一致的绿色高亮渲染;
- 新增(聊天):消息中的行内代码块高度被限制并启用内部滚动,长代码片段不再把后续对话挤出可视区域;
- 修复(对话框):`DialogContent` 限制到视口高度并启用内部滚动,Git 重置提交消息限高 8rem 带独立滚动条,长消息或小视口下底部按钮始终可见。
@Kwensiu Kwensiu deleted the feat/default-terminal-shell branch April 29, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants