# WispTerm v1.2.0

> **An AI copilot, right where you work.** A new right-side copilot sidebar binds
> to the focused terminal — ask questions in context without leaving your shell.
> This release also tightens Agent safety (always-confirm destructive commands,
> clean shell history) and fixes terminal mouse-button reporting.

## Added

- **In-context Copilot Sidebar (#98).** Press `Ctrl+Shift+A` (`Cmd+Shift+A` on macOS)
  on a terminal tab to toggle a right-side AI copilot bound to the currently focused
  terminal.
  - Each terminal tab keeps its **own** copilot conversation; closing the tab discards it.
  - Terminal actions default to the current terminal — no tab to pick before asking — and
    every message auto-includes a lightweight snapshot (the bound terminal's working
    directory plus its recent output) so the copilot has context without you pasting it.
  - Shares the default AI profile (same provider, model, and key) as the AI Agent.
  - Occupies the right panel slot **exclusively**: opening the copilot hides the browser
    panel and the Markdown preview, and opening either of those hides the copilot.
  - `Esc` is progressive — it first stops an in-flight request, then clears a selection,
    then hides the panel and returns focus to the terminal.
  - Drag the panel's left edge to resize it; the width is shared across terminal tabs.

## Changed

- **Agent: destructive commands always require confirmation.** `local_command`,
  `terminal_repl`, and `unix_session` exec tools now force an approval prompt for
  dangerous commands (e.g. `rm`, `mv`, `rename`, `format`, and other destructive verbs)
  **even when the Agent is granted full permission** — full mode no longer auto-runs them.
- **Agent: cleaner shell history.** `unix_session` command execution enables ignore-space
  (zsh `HIST_IGNORE_SPACE` / bash `HISTCONTROL=ignorespace`) and prefixes injected lines
  with a leading space, so the Agent's sentinel-wrapped commands stop polluting your shell
  history. Your own typed commands are unaffected.

## Fixed

- **Mouse: terminal now reports button clicks and drags to the PTY**, not just the wheel —
  fixing apps like `nvim` that previously didn't respond to clicking or selecting with the
  mouse.

## Notes

- The copilot is **terminal-only** — it does not open on AI Agent or other non-terminal tabs.
- macOS remains early — prefer Linux or Windows for daily use.

---

# WispTerm v1.2.0（中文）

> **把 AI 副驾放到你工作的地方。** 新增右侧 Copilot 侧边栏,绑定当前聚焦的终端——
> 无需离开 shell 即可在上下文中提问。本版本同时收紧了 Agent 安全性(危险命令始终需确认、
> 保持 shell 历史干净),并修复了终端鼠标按键上报。

## 新增

- **上下文内 Copilot 侧边栏(#98)。** 在终端标签页按 `Ctrl+Shift+A`(macOS 为
  `Cmd+Shift+A`)切换右侧 AI copilot,绑定到当前聚焦的终端。
  - 每个终端标签页保留**各自**的 copilot 会话;关闭标签页即丢弃。
  - 终端操作默认指向当前终端——提问前无需选择标签页——并且每条消息会自动附带一份轻量
    快照(所绑定终端的工作目录与最近输出),无需手动粘贴上下文。
  - 与 AI Agent 共享默认 AI 配置(相同的服务商、模型与密钥)。
  - **独占**右侧面板槽位:打开 copilot 会隐藏浏览器面板与 Markdown 预览,反之亦然。
  - `Esc` 为渐进式——先停止进行中的请求,再清除选区,最后隐藏面板并把焦点交还终端。
  - 拖拽面板左边缘可调整宽度;宽度在各终端标签页间共享。

## 变更

- **Agent:危险命令始终需要确认。** `local_command`、`terminal_repl`、`unix_session`
  执行工具现在对危险命令(如 `rm`、`mv`、`rename`、`format` 等破坏性动词)强制弹出确认,
  **即便 Agent 拥有 full 权限**——full 模式不再自动执行这些命令。
- **Agent:保持 shell 历史干净。** `unix_session` 执行命令时启用 ignore-space
  (zsh `HIST_IGNORE_SPACE` / bash `HISTCONTROL=ignorespace`),并在注入行前加一个空格,
  使 Agent 的 sentinel 包裹命令不再污染你的 shell 历史。你自己手输的命令不受影响。

## 修复

- **鼠标:终端现在会把按键点击与拖拽上报给 PTY**,不再只上报滚轮——修复了 `nvim` 等
  应用此前无法用鼠标点击或选择的问题。

## 说明

- copilot **仅限终端**——不会在 AI Agent 或其他非终端标签页中打开。
- macOS 仍处于早期阶段,日常使用建议优先 Linux 或 Windows。
