From 501fd4a7de70afb40de17f8a655621adcdc9f332 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Thu, 16 Jul 2026 11:45:33 +0800 Subject: [PATCH] docs(readme): rewrite in minimal style, reposition as terminal workbench MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Slim the READMEs to an index (why / install / what's inside / benchmarks); move feature details, keybindings, and performance notes to docs/features.md (en + zh-CN). New tagline: a terminal workbench — shells, sessions, SSH, coding agents. Sync the Cargo.toml description. --- Cargo.toml | 2 +- README.md | 137 ++++++++--------------------------------- README.zh-CN.md | 125 ++++++++----------------------------- docs/features.md | 86 ++++++++++++++++++++++++++ docs/features.zh-CN.md | 84 +++++++++++++++++++++++++ 5 files changed, 222 insertions(+), 212 deletions(-) create mode 100644 docs/features.md create mode 100644 docs/features.zh-CN.md diff --git a/Cargo.toml b/Cargo.toml index c8c76bb7..8a4a1917 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "tty7" version = "0.16.1" edition = "2024" -description = "A terminal built on Zed's gpui that never loses your session — daemon-backed, shell-aware" +description = "A terminal workbench: shells, persistent sessions, SSH, coding agents — GPU-rendered on Zed's gpui, pure Rust" repository = "https://github.com/l0ng-ai/tty7" license = "Apache-2.0" readme = "README.md" diff --git a/README.md b/README.md index bad9008e..696866a8 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ ### tty7 -**A GPU-rendered terminal in pure Rust.** +**A terminal workbench: shells, sessions, SSH, coding agents.** -GPU rendering on Zed's gpui · VT core from Alacritty +Pure Rust · GPU rendering on Zed's gpui · VT core from Alacritty
@@ -15,92 +15,44 @@ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE) [![Discord](https://img.shields.io/badge/Discord-join%20chat-5865F2?logo=discord&logoColor=white)](https://discord.gg/s3dethqz2V) -[**Why tty7**](#why-tty7) · [**Install**](#install) · [**Features**](#features) · [**Benchmarks**](#benchmarks) · [**Keybindings**](#keybindings) - English · [简体中文](README.zh-CN.md) -## Why tty7 +## Why -- **Fast** — about 2× the throughput of Alacritty, Ghostty, or Kitty on the - same hardware ([benchmarks](#benchmarks)) -- **A modern prompt** — completion, syntax highlighting, and history search - built in; no plugins to assemble -- **Sessions that survive** — close the window or quit the app, your shells - keep running; no tmux -- **Zero config** — zsh, bash, fish, and PowerShell work out of the box - -Native builds for macOS, Windows, and Linux ship with every release. +- **Fast** — ~2× the throughput of Alacritty, Ghostty, or Kitty ([benchmarks](#benchmarks)) +- **Sessions persist** — quit or reboot; your shells keep running, no tmux +- **Editor-grade input** — completion, syntax highlighting, history search built in; zero config for zsh, bash, fish, PowerShell +- **Agent-aware** — recognizes Claude Code & co. in a pane: status, notifications, session resume ## Install -Download the build for your platform from -[**Releases**](https://github.com/l0ng-ai/tty7/releases): +Native builds for each platform on [**Releases**](https://github.com/l0ng-ai/tty7/releases): -- **macOS** — `tty7--macos-arm64.dmg` (Apple Silicon) or `…-x86_64.dmg` - (Intel); open it and drag `tty7.app` into Applications. -- **Windows** — `…-windows-x86_64-setup.exe` (installer: Start Menu shortcut + - uninstall entry), or `…-windows-x86_64.zip` (portable: unzip and run - `tty7.exe`). -- **Linux** — `…-linux-x86_64.AppImage` (recommended: bundles the x11/wayland - libraries, so it runs on Fedora / Arch / etc. with no extra packages — - `chmod +x` and run), or `…-linux-x86_64.tar.gz` (bare binary; extract and run - `./tty7`, needs the usual x11/wayland runtime libraries installed). +| | | | +|---|---|---| +| **macOS** | `…-macos-arm64.dmg` · `…-x86_64.dmg` | drag into Applications | +| **Windows** | `…-setup.exe` · portable `….zip` | | +| **Linux** | `…-x86_64.AppImage` | `chmod +x` and run — x11/wayland libs bundled | -## Features +## What's inside -### At the prompt - -- **Ghost suggestions** — your history completes the whole line as you type; to accept -- **Tab completion that explains** — every flag and subcommand with its description, for ~100 common commands -- **Syntax highlighting** — as you type, nothing to install -- **Fuzzy history search** — ⌃ R shows what you ran, where, and whether it failed -- **History from day one** — your existing shell history just works, and carries across sessions -- **Real line editing** — selection, word motion, undo - -### In the window - -- **Tabs & splits** — always open in the current directory -- **Command palette** ⌘ P · scrollback search ⌘ F -- **⌘-click links** · desktop notifications -- **Eight themes** · CJK / IME input - -### CLI coding agents - -tty7 recognizes third-party coding agents running in a pane (Claude Code, -Codex, Gemini CLI, Aider, Amp, OpenCode, and ~10 more) and enriches them — it -never wraps or replaces the agent. - -- **Brand avatars** — the tab chip / sidebar row shows which agent runs where; custom wrappers map in via `agent_commands` in `config.json` -- **Live status dot** — working (blue) / needs your input (amber) / done (green), driven by agent-reported events over an OSC channel; run *Agent: Install Claude Code Hooks* from the palette to wire Claude Code up -- **Notifications that matter** — "needs your permission…" the moment an agent blocks on you, and "finished after Ns" per turn, honoring your notification policy -- **Branch at a glance** — each sidebar row shows its pane's git branch and working-tree diff (`+N −M`), refreshed on `cd` and when a command finishes -- **Session resume** — panes lost to a reboot re-launch their agent conversation (`claude --resume …`) on restore (`restore_agent_sessions`, on by default) -- **Context feed** — palette commands send the current selection or the repo's `git diff` to the running agent as a ready-made prompt - -### SSH connection manager - -A native Rust SSH stack (russh) is the **only** path — profiles, credentials, -and SFTP without ever shelling out to `ssh`. There is no system-ssh compat mode. - -- **QuickConnect** — type `user@host[:port]` in the palette and connect; IPv6 `[::1]:port` supported -- **Saved profiles** — full connection config with passwords / passphrases in the OS keychain, never on disk -- **`~/.ssh/config` aliases** — type one to connect (resolved natively — common fields, best-effort — over russh), or import them as profiles in Settings -- **GUI auth** — in-pane sheets for password, key passphrase, 2FA, and host-key confirmation (new vs. changed) -- **Built-in SFTP** — a slide-in file panel: browse, upload / download, rename / delete / chmod, drag to Finder -- **Port forwarding** — Local / Remote / Dynamic, preconfigured or added live, plus ⌘-click `localhost:PORT` to auto-forward -- **Jump hosts & proxies** — multi-hop via profile references or `ProxyJump`, ProxyCommand, SOCKS5 / HTTP - -| Entry point | Connects via | +| | | |---|---| -| Saved profiles · QuickConnect · typed `user@host[:port]` | Native russh — SFTP · keychain · GUI auth · L/R/D forwards | -| `~/.ssh/config` aliases | Resolved natively, then russh (`Match`/canonicalize/GSSAPI unsupported — no fallback) | +| **Input** | ghost suggestions from history · explained tab completion · syntax highlighting · multi-line editing · click places the caret · ⌃ R fuzzy history | +| **Window** | tabs & splits · ⌘ P palette · ⌘ F scrollback search · eight themes · IME | +| **Coding agents** | per-pane agent detection (~17 CLIs): status dot, notifications, branch + diff, resume after reboot | +| **SSH** | native russh stack: profiles with keychain secrets, SFTP panel, port forwarding, jump hosts | + +Details for every row: [docs/features.md](docs/features.md). Keybindings: ⌘ , +opens Settings — browse and remap everything, tmux preset included +([full list](docs/features.md#keybindings)). ## Benchmarks -All four terminals measured back-to-back on the same machine, same day, same -155×40 grid — Apple M1 Pro, macOS 26.3.1, five-run averages (2026-07-04): +Same machine, same day, same 155×40 grid — Apple M1 Pro, macOS 26.3.1, +five-run averages (2026-07-04): | | **tty7** | Alacritty | Ghostty | Kitty | |---|---:|---:|---:|---:| @@ -110,44 +62,7 @@ All four terminals measured back-to-back on the same machine, same day, same ¹ GUI 105 MB + the persistent daemon 11 MB. -Where the speed comes from: - -- The PTY is read at device speed and parsed in large batches, off the render path -- Hot paths are lock-free — a big `cat` never waits on drawing -- The daemon buffers up to 16 MiB ahead of the window before backpressure applies - -Methodology (how each terminal is driven, grid fairness, known pitfalls) and -one-command reproduction live in [`scripts/bench/`](scripts/bench/README.md) — -run it yourself. - -## Keybindings - -Keys are shown in macOS notation — on Windows and Linux, read as -Ctrl. Open Settings with ⌘ , to browse or remap them all. -The essentials: - -| | | -|---|---| -| ⌘ T · ⌘ W · ⌘ ⇧ T | new tab · close tab · reopen closed tab | -| ⌘ 1⌘ 9 · ⌃ ⇥ · ⌃ ⇧ ⇥ | jump to tab 1–9 · next tab · previous tab | -| ⌘ D · ⌘ ⇧ D | split right · split down | -| ⌘ ] · ⌘ [ | next pane · previous pane | -| ⌘ ⌥ ←→↑↓ | focus the pane in that direction | -| ⌘ ⏎ · ⌘ ⇧ ⏎ | toggle fullscreen · maximize / restore the pane | -| ⌘ K | clear the screen and scrollback | -| ⌘ P | command palette | -| ⌘ F | search the scrollback | -| ⌃ R | fuzzy-search shell history | -| ⌘ + · ⌘ − · ⌘ 0 | font size up · down · reset | - -**Settings → Keybindings** lists every shortcut. Click one, press the new keys -(Esc cancels, Backspace resets to default), and it takes -effect immediately. Pane resize and swap have no default keys — bind them here or -run them from the command palette. Prefer tmux muscle memory? Flip the **tmux** -preset to remap pane/tab actions onto a prefix (default ⌃ B): ⌃ B -C opens a tab, ⌃ B % splits, ⌃ B then an -arrow moves focus. A bare prefix reaches the shell after a brief pause, and -`prefix` + an unbound key is passed straight through to the terminal. +Methodology and one-command reproduction: [`scripts/bench/`](scripts/bench/README.md). --- diff --git a/README.zh-CN.md b/README.zh-CN.md index 90759c0f..c823643b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -4,9 +4,9 @@ ### tty7 -**纯 Rust 编写的 GPU 渲染终端。** +**终端工作台:shell、会话、SSH、coding agent。** -GPU 渲染基于 Zed 的 gpui · VT 内核来自 Alacritty +纯 Rust · GPU 渲染基于 Zed 的 gpui · VT 内核来自 Alacritty
@@ -15,85 +15,43 @@ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE) [![Discord](https://img.shields.io/badge/Discord-%E5%8A%A0%E5%85%A5%E7%BE%A4%E7%BB%84-5865F2?logo=discord&logoColor=white)](https://discord.gg/s3dethqz2V) -[**为什么是 tty7**](#为什么是-tty7) · [**安装**](#安装) · [**功能**](#功能) · [**基准测试**](#基准测试) · [**快捷键**](#快捷键) - [English](README.md) · 简体中文 -## 为什么是 tty7 +## 为什么 -- **快** —— 同一台机器上,吞吐约为 Alacritty、Ghostty、Kitty 的 - 2 倍([基准测试](#基准测试)) -- **现代的提示符** —— 补全、语法高亮、历史搜索全部内置,不用东拼西凑插件 -- **会话不死** —— 关窗口、退应用,shell 照样运行;无需 tmux -- **零配置** —— zsh、bash、fish、PowerShell 开箱即用 - -macOS、Windows、Linux 三平台原生构建,每个 release 一起打出。 +- **快** —— 吞吐约为 Alacritty、Ghostty、Kitty 的 2 倍([基准测试](#基准测试)) +- **会话常驻** —— 退应用、重启机器,shell 照样运行;无需 tmux +- **编辑器级输入** —— 补全、语法高亮、历史搜索内置;zsh、bash、fish、PowerShell 零配置 +- **认识 agent** —— 识别 pane 里的 Claude Code 等:状态、通知、会话恢复 ## 安装 -到 [**Releases**](https://github.com/l0ng-ai/tty7/releases) 下载对应平台的构建: +三平台原生构建都在 [**Releases**](https://github.com/l0ng-ai/tty7/releases): -- **macOS** —— `tty7--macos-arm64.dmg`(Apple Silicon)或 `…-x86_64.dmg` - (Intel);打开后把 `tty7.app` 拖进「应用程序」即可。 -- **Windows** —— `…-windows-x86_64-setup.exe`(安装包:带开始菜单快捷方式和 - 卸载入口),或 `…-windows-x86_64.zip`(便携版:解压后运行 `tty7.exe`)。 -- **Linux** —— `…-linux-x86_64.AppImage`(推荐:已打包 x11/wayland 依赖库, - Fedora / Arch 等发行版免装依赖,`chmod +x` 后直接运行),或 - `…-linux-x86_64.tar.gz`(裸二进制,解压后运行 `./tty7`,需自行装齐常见的 - x11/wayland 运行时库)。 +| | | | +|---|---|---| +| **macOS** | `…-macos-arm64.dmg` · `…-x86_64.dmg` | 拖进「应用程序」 | +| **Windows** | `…-setup.exe` · 便携版 `….zip` | | +| **Linux** | `…-x86_64.AppImage` | `chmod +x` 直接跑,x11/wayland 依赖已打包 | -## 功能 +## 有什么 -### 提示符 - -- **影子建议** —— 边打字边用你的历史补全整条命令, 接受 -- **会解释的 Tab 补全** —— 每个 flag、每个子命令都带说明,覆盖约 100 个常用命令 -- **语法高亮** —— 边打边亮,什么都不用装 -- **模糊历史搜索** —— ⌃ R 看到每条命令在哪跑的、什么时候、有没有失败 -- **历史开箱即用** —— 你已有的 shell 历史直接生效,并跨会话延续 -- **真正的行编辑** —— 选区、词级移动、撤销 - -### 窗口 - -- **标签页与分屏** —— 永远开在当前目录 -- **命令面板** ⌘ P · 回滚搜索 ⌘ F -- **⌘ 点击打开链接** · 桌面通知 -- **8 套主题** · CJK / 输入法输入 - -### CLI coding agent - -tty7 能识别 pane 里跑着的第三方 coding agent(Claude Code、Codex、Gemini CLI、Aider、Amp、OpenCode 等约 17 个)并为其增强体验 —— 只观察、只加分,绝不包裹或替代 agent 本身。 - -- **品牌头像** —— 标签 chip / 侧栏行显示每个 pane 跑的是哪个 agent;自定义包装命令可通过 `config.json` 的 `agent_commands` 映射 -- **实时状态点** —— 工作中(蓝)/ 等你输入(琥珀)/ 完成(绿),由 agent 自己上报的 OSC 事件驱动;在命令面板运行 *Agent: Install Claude Code Hooks* 一键接通 Claude Code -- **真正有用的通知** —— agent 卡在等你批准的那一刻弹 "needs your permission…",每轮结束弹 "finished after Ns",遵循你的通知策略 -- **一眼看分支** —— 侧栏每行显示该 pane 的 git 分支和工作区改动(`+N −M`),`cd` 或命令跑完时自动刷新 -- **会话恢复** —— 重启后无法重连的 pane 会自动续上 agent 对话(`claude --resume …`;`restore_agent_sessions`,默认开启) -- **上下文回填** —— 面板命令把当前选区或仓库 `git diff` 打包成 prompt 直接喂给正在跑的 agent - -### SSH 连接管理器 - -**唯一**路径就是原生 Rust SSH 栈(russh)—— profile、凭据、SFTP 全部内置,绝不 shell 出 `ssh`。没有系统 ssh 兼容模式。 - -- **QuickConnect** —— 面板里打 `user@host[:port]` 回车即连;支持 IPv6 `[::1]:port` -- **保存 profile** —— 完整连接配置,密码 / passphrase 进 OS keychain,绝不落盘 -- **`~/.ssh/config` alias** —— 直接输入 alias 即连(原生解析常用字段,尽力而为,走 russh),也可在设置页一键导入为 profile -- **GUI 认证** —— pane 内 sheet 输入密码、私钥 passphrase、2FA,并确认主机密钥(新主机 vs 已变更) -- **内置 SFTP** —— 滑入式文件面板:浏览、上传 / 下载、重命名 / 删除 / chmod,可拖进 Finder -- **端口转发** —— Local / Remote / Dynamic,预配置或运行时增删,外加 ⌘ 点击 `localhost:PORT` 一键转发 -- **跳板与代理** —— 经 profile 引用或 `ProxyJump` 多跳、ProxyCommand、SOCKS5 / HTTP - -| 入口 | 连接方式 | +| | | |---|---| -| 保存 profile · QuickConnect · 输入 `user@host[:port]` | 原生 russh —— SFTP · keychain · GUI 认证 · L/R/D 转发 | -| `~/.ssh/config` alias | 原生解析后走 russh(`Match`/canonicalize/GSSAPI 不支持,且无回退) | +| **输入** | 历史影子建议 · 带说明的 Tab 补全 · 语法高亮 · 多行编辑 · 点击定位光标 · ⌃ R 模糊历史搜索 | +| **窗口** | 标签页与分屏 · ⌘ P 命令面板 · ⌘ F 回滚搜索 · 8 套主题 · 输入法 | +| **Coding agent** | 按 pane 识别约 17 个 CLI agent:状态点、通知、分支 + diff、重启后续上会话 | +| **SSH** | 原生 russh 栈:profile 凭据进 keychain、SFTP 面板、端口转发、跳板机 | + +每一行的细节见 [docs/features.zh-CN.md](docs/features.zh-CN.md)。快捷键:⌘ , +打开设置,可查看、重绑全部键位,含 tmux 预设([完整列表](docs/features.zh-CN.md#快捷键))。 ## 基准测试 -四款终端在同一台机器上依次测完,网格统一为 155×40 —— Apple M1 Pro, -macOS 26.3.1,取五次运行的平均值(2026-07-04): +同一台机器、同一天、统一 155×40 网格 —— Apple M1 Pro,macOS 26.3.1, +取五次运行的平均值(2026-07-04): | | **tty7** | Alacritty | Ghostty | Kitty | |---|---:|---:|---:|---:| @@ -103,40 +61,7 @@ macOS 26.3.1,取五次运行的平均值(2026-07-04): ¹ GUI 105 MB + 常驻守护进程 11 MB。 -速度从哪来: - -- 以设备速度读取 PTY,在渲染路径之外成批解析 -- 热路径全程无锁 —— 再大的 `cat` 也不会阻塞在渲染上 -- 触发背压前,守护进程最多可领先窗口缓冲 16 MiB - -测试方法(每款终端怎么驱动、网格是否公平、有哪些坑)连同一键复现脚本,都放在 -[`scripts/bench/`](scripts/bench/README.md),欢迎自己跑一遍。 - -## 快捷键 - -下表按 macOS 记法书写 —— 在 Windows 和 Linux 上,把 读作 -Ctrl。按 ⌘ , 打开设置,可查看或重新映射全部键位。最常用的几个: - -| | | -|---|---| -| ⌘ T · ⌘ W · ⌘ ⇧ T | 新建标签页 · 关闭标签页 · 恢复关闭的标签页 | -| ⌘ 1⌘ 9 · ⌃ ⇥ · ⌃ ⇧ ⇥ | 跳到第 1–9 个标签页 · 下一个 · 上一个标签页 | -| ⌘ D · ⌘ ⇧ D | 向右分屏 · 向下分屏 | -| ⌘ ] · ⌘ [ | 下一个窗格 · 上一个窗格 | -| ⌘ ⌥ ←→↑↓ | 按方向切换焦点窗格 | -| ⌘ ⏎ · ⌘ ⇧ ⏎ | 切换全屏 · 最大化 / 还原窗格 | -| ⌘ K | 清屏并清空回滚缓冲区 | -| ⌘ P | 命令面板 | -| ⌘ F | 搜索回滚缓冲区 | -| ⌃ R | 模糊搜索 shell 历史 | -| ⌘ + · ⌘ − · ⌘ 0 | 字号增大 · 减小 · 重置 | - -**Settings → Keybindings** 列出全部快捷键。点一行、按下新键即可(Esc -取消,Backspace 恢复默认),改完立即生效。窗格缩放与交换默认不绑定键 —— -在这里绑定,或从命令面板执行。习惯 tmux?打开 **tmux** 预设,把窗格/标签页操作 -映射到前缀键(默认 ⌃ B):⌃ B C 新建标签页, -⌃ B % 分屏,⌃ B 接方向键切换焦点。单独按前缀键会在 -短暂延迟后送达 shell,`前缀` + 未绑定的键会原样透传给终端。 +测试方法与一键复现脚本:[`scripts/bench/`](scripts/bench/README.md)。 --- diff --git a/docs/features.md b/docs/features.md new file mode 100644 index 00000000..00d8aa85 --- /dev/null +++ b/docs/features.md @@ -0,0 +1,86 @@ +# Features + +English · [简体中文](features.zh-CN.md) + +## Input + +- **Ghost suggestions** — your history completes the whole line as you type; to accept +- **Explained tab completion** — every flag and subcommand with its description, for ~100 common commands +- **Syntax highlighting** — as you type, nothing to install +- **Fuzzy history search** — ⌃ R shows what you ran, where, and whether it failed +- **History from day one** — your existing shell history works as-is and carries across sessions +- **Line editing** — click to place the caret, mouse selection, word motion, undo +- **Multi-line editing** — wrapped and multi-line commands edit in place; the grid shifts to keep the caret visible + +## In the window + +- **Tabs & splits** — always open in the current directory +- **Command palette** ⌘ P · scrollback search ⌘ F +- **⌘-click links** · desktop notifications · copy on select (opt-in, Settings → Terminal → Clipboard) +- **Eight themes** · CJK / IME input + +## Coding agents + +tty7 recognizes third-party coding agents running in a pane (Claude Code, +Codex, Gemini CLI, Aider, Amp, OpenCode, and ~10 more) and adds around them — +it never wraps or replaces the agent. + +- **Brand avatars** — the tab chip / sidebar row shows which agent runs where; custom wrappers map in via `agent_commands` in `config.json` +- **Status dot** — working (blue) / needs your input (amber) / done (green), driven by agent-reported events over an OSC channel; run *Agent: Install Claude Code Hooks* from the palette to wire Claude Code up +- **Notifications** — "needs your permission…" the moment an agent blocks on you, and "finished after Ns" per turn, honoring your notification policy +- **Branch at a glance** — each sidebar row shows its pane's git branch and working-tree diff (`+N −M`), refreshed on `cd` and when a command finishes +- **Session resume** — panes lost to a reboot re-launch their agent conversation (`claude --resume …`) on restore (`restore_agent_sessions`, on by default) +- **Context feed** — palette commands send the current selection or the repo's `git diff` to the running agent as a ready-made prompt + +## SSH + +A native Rust SSH stack (russh) is the **only** path — profiles, credentials, +and SFTP without shelling out to `ssh`. There is no system-ssh compat mode. + +- **QuickConnect** — type `user@host[:port]` in the palette and connect; IPv6 `[::1]:port` supported +- **Saved profiles** — full connection config with passwords / passphrases in the OS keychain, never on disk +- **`~/.ssh/config` aliases** — type one to connect (resolved natively — common fields, best-effort — over russh), or import them as profiles in Settings +- **GUI auth** — in-pane sheets for password, key passphrase, 2FA, and host-key confirmation (new vs. changed) +- **Built-in SFTP** — a slide-in file panel: browse, upload / download, rename / delete / chmod, drag to Finder +- **Port forwarding** — Local / Remote / Dynamic, preconfigured or added live, plus ⌘-click `localhost:PORT` to auto-forward +- **Jump hosts & proxies** — multi-hop via profile references or `ProxyJump`, ProxyCommand, SOCKS5 / HTTP + +| Entry point | Connects via | +|---|---| +| Saved profiles · QuickConnect · typed `user@host[:port]` | Native russh — SFTP · keychain · GUI auth · L/R/D forwards | +| `~/.ssh/config` aliases | Resolved natively, then russh (`Match`/canonicalize/GSSAPI unsupported — no fallback) | + +## Keybindings + +Keys are shown in macOS notation — on Windows and Linux, read as +Ctrl. The essentials: + +| | | +|---|---| +| ⌘ T · ⌘ W · ⌘ ⇧ T | new tab · close tab · reopen closed tab | +| ⌘ 1⌘ 9 · ⌃ ⇥ · ⌃ ⇧ ⇥ | jump to tab 1–9 · next tab · previous tab | +| ⌘ D · ⌘ ⇧ D | split right · split down | +| ⌘ ] · ⌘ [ | next pane · previous pane | +| ⌘ ⌥ ←→↑↓ | focus the pane in that direction | +| ⌘ ⏎ · ⌘ ⇧ ⏎ | toggle fullscreen · maximize / restore the pane | +| ⌘ K | clear the screen and scrollback | +| ⌘ P | command palette | +| ⌘ F | search the scrollback | +| ⌃ R | fuzzy-search shell history | +| ⌘ + · ⌘ − · ⌘ 0 | font size up · down · reset | + +**Settings → Keybindings** (⌘ ,) lists every shortcut. Click one, +press the new keys (Esc cancels, Backspace resets to +default), and it takes effect immediately. Pane resize and swap have no default +keys — bind them here or run them from the command palette. + +**tmux preset** — remaps pane/tab actions onto a prefix (default ⌃ B): +⌃ B C opens a tab, ⌃ B % splits, +⌃ B then an arrow moves focus. A bare prefix reaches the shell after +a brief pause; `prefix` + an unbound key passes straight through. + +## Performance notes + +- The PTY is read at device speed and parsed in large batches, off the render path +- Hot paths are lock-free — a big `cat` never waits on drawing +- The daemon buffers up to 16 MiB ahead of the window before backpressure applies diff --git a/docs/features.zh-CN.md b/docs/features.zh-CN.md new file mode 100644 index 00000000..48851018 --- /dev/null +++ b/docs/features.zh-CN.md @@ -0,0 +1,84 @@ +# 功能 + +[English](features.md) · 简体中文 + +## 输入 + +- **影子建议** —— 边打字边用你的历史补全整条命令, 接受 +- **带说明的 Tab 补全** —— 每个 flag、每个子命令都带说明,覆盖约 100 个常用命令 +- **语法高亮** —— 边打边亮,什么都不用装 +- **模糊历史搜索** —— ⌃ R 看到每条命令在哪跑的、什么时候、有没有失败 +- **历史开箱即用** —— 你已有的 shell 历史直接生效,并跨会话延续 +- **行编辑** —— 点击定位光标、鼠标选区、词级移动、撤销 +- **多行编辑** —— 折行和多行命令原地编辑;网格自动上移,光标始终可见 + +## 窗口 + +- **标签页与分屏** —— 永远开在当前目录 +- **命令面板** ⌘ P · 回滚搜索 ⌘ F +- **⌘ 点击打开链接** · 桌面通知 · 划选即复制(可选,设置 → 终端 → 剪贴板) +- **8 套主题** · CJK / 输入法输入 + +## Coding agent + +tty7 能识别 pane 里跑着的第三方 coding agent(Claude Code、Codex、Gemini CLI、 +Aider、Amp、OpenCode 等约 17 个)并在其外围加功能 —— 绝不包裹或替代 agent 本身。 + +- **品牌头像** —— 标签 chip / 侧栏行显示每个 pane 跑的是哪个 agent;自定义包装命令可通过 `config.json` 的 `agent_commands` 映射 +- **状态点** —— 工作中(蓝)/ 等你输入(琥珀)/ 完成(绿),由 agent 自己上报的 OSC 事件驱动;在命令面板运行 *Agent: Install Claude Code Hooks* 一键接通 Claude Code +- **通知** —— agent 卡在等你批准的那一刻弹 "needs your permission…",每轮结束弹 "finished after Ns",遵循你的通知策略 +- **一眼看分支** —— 侧栏每行显示该 pane 的 git 分支和工作区改动(`+N −M`),`cd` 或命令跑完时自动刷新 +- **会话恢复** —— 重启后无法重连的 pane 会自动续上 agent 对话(`claude --resume …`;`restore_agent_sessions`,默认开启) +- **上下文回填** —— 面板命令把当前选区或仓库 `git diff` 打包成 prompt 直接喂给正在跑的 agent + +## SSH + +**唯一**路径就是原生 Rust SSH 栈(russh)—— profile、凭据、SFTP 全部内置, +不 shell 出 `ssh`,也没有系统 ssh 兼容模式。 + +- **QuickConnect** —— 面板里打 `user@host[:port]` 回车即连;支持 IPv6 `[::1]:port` +- **保存 profile** —— 完整连接配置,密码 / passphrase 进 OS keychain,不落盘 +- **`~/.ssh/config` alias** —— 直接输入 alias 即连(原生解析常用字段,尽力而为,走 russh),也可在设置页一键导入为 profile +- **GUI 认证** —— pane 内 sheet 输入密码、私钥 passphrase、2FA,并确认主机密钥(新主机 vs 已变更) +- **内置 SFTP** —— 滑入式文件面板:浏览、上传 / 下载、重命名 / 删除 / chmod,可拖进 Finder +- **端口转发** —— Local / Remote / Dynamic,预配置或运行时增删,外加 ⌘ 点击 `localhost:PORT` 一键转发 +- **跳板与代理** —— 经 profile 引用或 `ProxyJump` 多跳、ProxyCommand、SOCKS5 / HTTP + +| 入口 | 连接方式 | +|---|---| +| 保存 profile · QuickConnect · 输入 `user@host[:port]` | 原生 russh —— SFTP · keychain · GUI 认证 · L/R/D 转发 | +| `~/.ssh/config` alias | 原生解析后走 russh(`Match`/canonicalize/GSSAPI 不支持,且无回退) | + +## 快捷键 + +下表按 macOS 记法书写 —— 在 Windows 和 Linux 上,把 读作 +Ctrl。最常用的几个: + +| | | +|---|---| +| ⌘ T · ⌘ W · ⌘ ⇧ T | 新建标签页 · 关闭标签页 · 恢复关闭的标签页 | +| ⌘ 1⌘ 9 · ⌃ ⇥ · ⌃ ⇧ ⇥ | 跳到第 1–9 个标签页 · 下一个 · 上一个标签页 | +| ⌘ D · ⌘ ⇧ D | 向右分屏 · 向下分屏 | +| ⌘ ] · ⌘ [ | 下一个窗格 · 上一个窗格 | +| ⌘ ⌥ ←→↑↓ | 按方向切换焦点窗格 | +| ⌘ ⏎ · ⌘ ⇧ ⏎ | 切换全屏 · 最大化 / 还原窗格 | +| ⌘ K | 清屏并清空回滚缓冲区 | +| ⌘ P | 命令面板 | +| ⌘ F | 搜索回滚缓冲区 | +| ⌃ R | 模糊搜索 shell 历史 | +| ⌘ + · ⌘ − · ⌘ 0 | 字号增大 · 减小 · 重置 | + +**Settings → Keybindings**(⌘ ,)列出全部快捷键。点一行、按下新键即可 +(Esc 取消,Backspace 恢复默认),改完立即生效。窗格缩放与 +交换默认不绑定键 —— 在这里绑定,或从命令面板执行。 + +**tmux 预设** —— 把窗格/标签页操作映射到前缀键(默认 ⌃ B): +⌃ B C 新建标签页,⌃ B % 分屏, +⌃ B 接方向键切换焦点。单独按前缀键会在短暂延迟后送达 shell, +`前缀` + 未绑定的键原样透传给终端。 + +## 性能说明 + +- 以设备速度读取 PTY,在渲染路径之外成批解析 +- 热路径全程无锁 —— 再大的 `cat` 也不会阻塞在渲染上 +- 触发背压前,守护进程最多可领先窗口缓冲 16 MiB