mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-21 16:02:20 +00:00
* fix(update): surface a failed install instead of silently re-prompting (#540) The GUI quits as soon as tty7-updater is spawned, so an install that failed inside the helper left a trace only in update.log — and because launching the helper had already cleared the prompt state, the next check offered the same version again, and again. The failure mode the user saw was an app that nagged about an update it could not install. The helper now writes update-outcome.json beside update.json on every terminal path it can still reach, and the next GUI launch folds it into the update state: a failure shows in Settings with the installer's own reason until dismissed and stops the version from re-prompting on its own; a success at the running version retires a failure an earlier attempt recorded. A leftover result that exists but cannot be parsed is reported rather than dropped — something ran, and "unreadable" is a result too. The same change moves the config directory off the environment and onto the command line (--config-dir). An elevated child process does not inherit the spawner's environment, so TTY7_CONFIG_DIR would have fallen back to the administrator's config directory exactly in the over-the-shoulder case — the groundwork this lays for #504. The updater re-exports the variable for the helper children it spawns itself, so the relaunched app keeps answering for the same config directory. * feat(update): update an all-users Windows install through one UAC prompt (#504) An Inno install under C:\Program Files could not be replaced in place: the updater ran the release Setup as the signed-in user, which either installed a second, per-user copy beside the real one or let Inno re-launch itself elevated — a bare UAC prompt for an unsigned executable in %TEMP%, seconds after the GUI had vanished. So the layout was refused outright and told to download by hand. It now updates itself, with the split the design in #504 settled on: one UAC prompt covering two privileged stages, and one watcher that is never elevated at all. - The GUI probes the *installed* updater for the new verbs by running it ("capabilities"), so a side-loaded or downgraded binary answers for itself instead of being trusted by version number. An updater that predates the verbs exits with a usage error, and the install falls back to pointing at the release page exactly as before — the first release carrying this still updates the old way, and the one after it updates itself. - The prompt dialog says the UAC prompt is coming before the app quits, and stops offering "Install on Next Launch": nobody is there to answer a prompt before the first window exists. The same guard keeps a staged plan from being armed for the next launch, and apply_pending_at_launch leaves an elevation-needing plan staged rather than raising a windowless prompt at boot. - "Install now" spawns the watcher first (medium integrity, the signed-in user's token, so the relaunched app is never elevated), then ShellExecuteEx "runas" on the installed updater — the trust root a medium-integrity process cannot rewrite. Everything the elevated half needs crosses as command-line arguments, because an over-the-shoulder child inherits neither the environment nor the user's profile. The package's expected SHA-256 crosses the same way, from the checksums the GUI already holds in memory, so a payload and its checksums file cannot be rewritten together behind the IL boundary. - The privileged first stage re-verifies the payload against that digest, pins its helper byte-for-byte to the installed updater, stages both in a fresh administrator-only %ProgramData% directory (an explicit SDDL DACL, swept of stale directories first), and only then runs the install stage — which runs Setup silently, writes the outcome file, and never touches the app binary itself. The watcher follows the chain through the status file and pid liveness (ERROR_ACCESS_DENIED from OpenProcess still means "alive" across accounts), then relaunches the app de-elevated and probes that it actually came up. - Declining the UAC prompt is not an error: the watcher is reaped, nothing ran elevated, and the staged package simply waits in Settings. Persisted plans from before this protocol serde-default a plan version that is_usable rejects, so a stale plan is discarded instead of failing against a helper that would not understand its arguments. The installer script's explorer-menu registration gains skipifsilent: a silent run *is* this update path, and launching the app there would write the menu into the administrator's hive under over-the-shoulder elevation. One note on the test suite: ui::remote_connect's a_routed_auth_prompt_carries_the_machine_that_raised_it fails under parallel test execution on this machine both with and without this change — a pre-existing flake, unrelated. * fix(update): run the UAC request off the UI thread Real-machine verification of the elevated chain caught this on the first click: ShellExecuteExW pumps the calling thread's message loop while the shell raises the consent prompt (its change notifications re-enter the window), and from the UI thread that re-enters gpui with its App already borrowed — the process aborts on a RefCell double-borrow before anything ever elevates. The launch — watcher spawn included, so the pairing stays atomic — now runs on the background executor, and only the bookkeeping (quit / decline / failure) comes back to the UI thread. * fix(update): throttle a failed version instead of retiring it (#540) Per the review on #540: a failed install must not keep the version retired via last_prompted — record last_prompted plus a fresh remind_after deadline (the same three days "Later" uses), so the version asks again once the reminder expires. should_prompt already treats "last_prompted matches, reminder expired" as prompt-again, so no logic change is needed there, and the pinned a_failure_lets_the_version_prompt_again test still holds. Also write update-outcome.json *before* relaunching the previous app on the macOS/Windows/portable non-elevated paths: the GUI that comes up next is exactly the process that absorbs the outcome, and it used to be relaunched before the failure existed on disk. The elevated chain is unchanged — its watcher already waited for the file. * fix(update): let only the elevated updater's own image name the trust root Three holes on the privileged side of the #504 chain, all of the same shape: a value that decides what runs elevated was taken from the medium-integrity caller. - `elevated-stage` pinned the staged helper against `<install-dir>\tty7-updater.exe`, where `<install-dir>` is a command-line argument. Both halves of that comparison were the caller's to choose: name a directory holding two copies of any binary and the pin passes, then stage 2 runs it elevated. The stage now derives the installation from its own image — UAC pointed the prompt at `{app}\tty7-updater.exe`, so `current_exe` is the one path nothing below the boundary could have written — and passes that on to stage 2. A caller that named a different directory only gets a line in the log. - The staging directory's DACL let no standard user in, but its parent did: `%ProgramData%` grants Users the right to create directories, and the creator owns what it creates. A pre-created `%ProgramData%\tty7` gave its owner delete-child over the administrator-only staging inside it — enough to rename the verified staging aside and drop an identical name of their own into the gap between the digest check and the execute. The root is now created with the same protected descriptor, taking down whatever holds the name first; `CreateDirectoryW` applies a descriptor only when it is the one creating the directory, so succeeding is the proof. The per-run sweep goes with it — the root's removal takes the leftovers. - The GUI aimed the prompt at the updater the *plan* named, and `update.json` sits in the user's config directory. It now aims at the installation this process runs from, so the binary the prompt names is the binary that starts. Also quote the elevated command line the way `CommandLineToArgvW` reads it back: a backslash escapes only in front of a quote, so a config directory ending in one used to escape its own closing quote and swallow every argument after it, `--result-file` — the file the watcher waits on — included. * test(update): pin the elevated stage's trust root to its own image A regression test for the shape of the hole rather than the hole: if `installed_root` ever goes back to reading an argument, the pin the elevated stage runs before executing the staged helper stops meaning anything, and nothing else in the suite would notice. * fix(update): bring tty7 back when the elevated chain never reports The watcher's two timeouts returned without relaunching. Every other way out of the chain ends with the app back on screen, but a stage 1 that died before writing its status or its outcome — killed, crashed, an AppInfo service that never delivered it — left the user with the GUI already quit, nothing to replace it, and nothing said. Same for an install still running an hour later. Both paths now end the way the others do: an outcome the watcher wrote itself, then the relaunch. The synthesized outcome is written whether or not the relaunch succeeds, which also closes the same gap on the pre-existing "the elevated updater exited without recording a result" path — the next launch can name what happened instead of silently offering the version again. What kept those paths from relaunching was the risk of a second window beside a GUI that is still up: a declined prompt leaves this process running, and the kill that reaps its watcher can lose. The watcher now takes the GUI's pid and opens a handle to it at startup — while the GUI is provably alive, since it is sitting in ShellExecuteExW waiting on the prompt — so the number cannot be recycled out from under it. Before relaunching, a GUI that is still alive is waited out for 30 seconds: one that is quitting (a chain that failed fast can beat it out the door) is gone well inside that and gets its relaunch, one that is staying is recognized as staying and gets neither a relaunch nor a failure record it did not earn. A live process always answers to its own pid, so the check cannot be wrong in the direction that double-launches. Also give the Japanese elevation notice its closing 。 * fix(update): poll the parent out across the elevation account boundary Under an over-the-shoulder elevation the install stage runs as the administrator, and OpenProcess on the signed-in user's GUI answers ERROR_ACCESS_DENIED - the same boundary pid_alive already documents from the watcher's side. wait_for_exit treated that as a fatal error, so the chain recovered and reported a failure before Setup ever ran. The wait now degrades to polling the pid until it stops answering, bounded so a recycled pid cannot hold the install hostage forever. --------- Co-authored-by: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Co-authored-by: l0ng-ai <l0ng-ai@users.noreply.github.com>
397 lines
20 KiB
TOML
397 lines
20 KiB
TOML
[package]
|
|
name = "tty7"
|
|
version.workspace = true
|
|
edition = "2024"
|
|
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"
|
|
publish = false
|
|
default-run = "tty7-app"
|
|
|
|
[[bin]]
|
|
name = "tty7-app"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "tty7-updater"
|
|
path = "src/bin/tty7-updater.rs"
|
|
required-features = ["updater"]
|
|
|
|
[dependencies]
|
|
# The framework-free half of tty7: wire protocol, session daemon, PTY, the
|
|
# native SSH engine, and the domain model the headless `tty7-server` shares with
|
|
# this GUI. Everything that does *not* need gpui lives there.
|
|
# `gssapi` is off in tty7-core's defaults (a static musl `tty7-server` cannot
|
|
# link the system krb5 it binds); the GUI, which builds against a real desktop
|
|
# toolchain, turns it on so managed SSH connections keep offering
|
|
# `gssapi-with-mic` exactly as before.
|
|
#
|
|
# `remote-install` is off there for the same shape of reason: it pulls an HTTPS
|
|
# client used only to *download* a `tty7-server` onto a remote machine
|
|
# (decision D5). The server binary is the thing being downloaded, so it can
|
|
# never take that path; the GUI, which is the client that pushes it, can.
|
|
tty7-core = { path = "crates/tty7-core", features = ["gssapi", "remote-install"] }
|
|
|
|
gpui = { workspace = true }
|
|
gpui_platform = { workspace = true }
|
|
gpui-component = { workspace = true }
|
|
gpui-component-assets = { workspace = true }
|
|
|
|
anyhow.workspace = true
|
|
log.workspace = true
|
|
# Smart double-click selection patterns (URL/email/path). Already in the tree
|
|
# transitively, so pinning it here adds no new native code.
|
|
regex = "1"
|
|
# SIMD byte search for `ParkedCursorScanner`'s fast path
|
|
# (`terminal::parked_cursor`), which scans every output batch the client
|
|
# receives — the same skip-ahead the
|
|
# tokenizers in `tty7-core` already use. Already in the tree via `tty7-core`,
|
|
# so this pins no new code.
|
|
memchr = "2"
|
|
# Grapheme-cluster boundaries for the sidebar's label elision
|
|
# (`ui::tab_strip`). Cutting a label by `char` tears emoji apart: a ZWJ
|
|
# sequence loses its joiner, `❤️` loses the variation selector that makes it an
|
|
# emoji, and half a flag renders as a bare letter. Already in the tree via
|
|
# gpui, so this pins no new code.
|
|
unicode-segmentation = "1"
|
|
smol.workspace = true
|
|
smallvec.workspace = true
|
|
serde = { workspace = true }
|
|
serde_json.workspace = true
|
|
tempfile = "3"
|
|
|
|
# SSH profile ids in the connection manager UI (`ui::ssh_connect`,
|
|
# `ui::settings`, the command palette). The profiles themselves — and the
|
|
# secret-free `CredentialRef` they carry — live in `tty7-core`, which `Config`
|
|
# needs to parse `config.json` without gpui.
|
|
uuid = { version = "1", features = ["v4", "serde"] }
|
|
|
|
# The credential vault's storage half (`core::keychain`). `keyring` 4.x's default
|
|
# `v1` feature auto-selects the platform store (macOS Keychain / Windows
|
|
# Credential Manager / Linux Secret Service), so no per-platform guards are
|
|
# needed.
|
|
#
|
|
# It sits here rather than in `tty7-core` on purpose: every caller is in `ui::`
|
|
# (`ssh_prompt`, `ssh_connect`, `settings`, `app`), and leaving it downstairs made
|
|
# the headless `tty7-server` — a static binary pushed onto machines that have no
|
|
# keychain at all — link `zbus`/`secret-service` and thirty-odd crates behind them
|
|
# for code it can never reach. Only the secret-free naming half (`CredentialRef`,
|
|
# the account scheme) stays in core, where `config.json` parsing needs it.
|
|
keyring = "4"
|
|
|
|
# Theme files. tty7 themes are authored as YAML (`~/.config/tty7/themes/*.yaml`,
|
|
# our own schema); `plist` parses imported iTerm2 `.itermcolors` schemes (XML
|
|
# plist) so the large iTerm color-scheme ecosystem drops straight in. serde_yaml
|
|
# is already in the tree transitively, so it pins no new code; plist is pure Rust.
|
|
serde_yaml = "0.9"
|
|
plist = "1"
|
|
|
|
# Clipboard-image paste (`terminal::view`). When the clipboard holds a screenshot
|
|
# and a coding-agent TUI (Claude Code &co.) is in the pane, off macOS we stage the
|
|
# image to a temp file and paste its path — agents attach an image path the same way
|
|
# they do a drag-drop. Windows screenshots arrive as BMP (`CF_DIB`), which agent
|
|
# vision won't accept, so we transcode to PNG. `image` is already in the tree via
|
|
# gpui's own clipboard code, so pinning it here adds no new native code.
|
|
image = "0.25"
|
|
|
|
# HTTP client for the startup update check (`core::update`): one GET to the
|
|
# GitHub releases API to see if a newer version has shipped. `reqwest_client`
|
|
# wraps Zed's `zed-reqwest` fork behind gpui's `http_client` trait (re-exported
|
|
# as `gpui::http_client`) and manages its own tokio runtime. That reqwest+rustls
|
|
# stack is *already* compiled into the tree via `gpui-component-assets`, so this
|
|
# pins no new native code — it only exposes what we're already building. Pinned
|
|
# to gpui's rev so the shared `http_client`/`zed-reqwest` versions stay aligned.
|
|
reqwest_client = { git = "https://github.com/zed-industries/zed", rev = "1d217ee39d381ac101b7cf49d3d22451ac1093fe" }
|
|
|
|
# See `[workspace.dependencies]`: the pin is shared with tty7-cli, which parses
|
|
# `capture` output through the same grid.
|
|
alacritty_terminal.workspace = true
|
|
|
|
# Desktop notifications driven by OSC 9 / OSC 777 escape sequences. Cross-platform;
|
|
# the macOS backend uses the deprecated NSUserNotification (weak — a completion
|
|
# toast is fine, revisit mac-notification-sys if it proves unusable).
|
|
notify-rust = "4"
|
|
|
|
# Filesystem watcher for live config reload: watches `config.json` and reloads
|
|
# `Config` + re-applies the theme without a restart. The code panel (file tree /
|
|
# editor, `ui::code`) reuses it to refresh the tree and detect external edits.
|
|
notify = "8"
|
|
|
|
# System tray / menu bar status item (`ui::tray`). Rasterizes the bundled SVG
|
|
# logo into the tray bitmap at runtime — gpui's own SVG path only yields a
|
|
# tinted alpha mask, not raw RGBA. The gpui and gpui-component forks both pin
|
|
# the same 0.47, so the whole tree shares a single resvg/usvg/tiny-skia stack;
|
|
# default features off drops the text/font machinery our icon SVGs don't use.
|
|
resvg = { version = "0.47", default-features = false }
|
|
|
|
# The tray icon itself, macOS + Windows: tauri's `tray-icon` (NSStatusItem /
|
|
# Shell_NotifyIcon via objc2 / windows-sys, both already in the tree). Linux is
|
|
# deliberately NOT on this crate — its Linux backend needs GTK + libappindicator,
|
|
# which tty7's AppImage doesn't bundle and the x11/wayland gpui backends don't
|
|
# pull. Linux instead uses `ksni` below.
|
|
[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
|
|
tray-icon = "0.24"
|
|
|
|
# The pty-size ioctl in `terminal::generator` is the only libc user left in the
|
|
# GUI (the daemon's own libc calls went to tty7-core), and it is Unix-only — so
|
|
# the dep is Unix-only too.
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2"
|
|
|
|
# `core::cli_install` edits HKCU\Environment to put the bundled CLI on PATH.
|
|
# `setx` is not an option there: it truncates at 1024 characters, so a long user
|
|
# PATH comes back mangled. 0.61 is already in the tree (tray-icon pulls it), so
|
|
# this pins no new code.
|
|
[target.'cfg(windows)'.dependencies]
|
|
windows-sys = { version = "0.61", features = [
|
|
"Win32_Foundation",
|
|
"Win32_Storage_FileSystem",
|
|
# ConvertStringSecurityDescriptorToSecurityDescriptorW + SECURITY_ATTRIBUTES:
|
|
# the elevated updater's %ProgramData% staging directory gets an explicit
|
|
# admin-only DACL (see `create_dir_admin_only` in tty7-updater).
|
|
"Win32_Security",
|
|
"Win32_Security_Authorization",
|
|
"Win32_System_Registry",
|
|
"Wdk_System_SystemServices",
|
|
"Win32_System_SystemInformation",
|
|
# `MessageBeep` (the terminal bell in `terminal::view`) is a user32 export,
|
|
# but the Win32 metadata files it under Diagnostics::Debug, so that is the
|
|
# module the binding needs — nothing here pulls in dbghelp.
|
|
"Win32_System_Diagnostics_Debug",
|
|
"Win32_System_Threading",
|
|
"Win32_UI_Shell",
|
|
"Win32_UI_WindowsAndMessaging",
|
|
] }
|
|
# The standalone updater extracts only Windows release ZIPs. Reuse the async
|
|
# reader already present in Cargo.lock and enable only the Deflate codec emitted
|
|
# by PowerShell's Compress-Archive.
|
|
async_zip = { version = "0.0.18", default-features = false, features = ["deflate"], optional = true }
|
|
|
|
# COM for toast branding (`core::aumid`): IShellLinkW + IPropertyStore stamp
|
|
# System.AppUserModel.ID onto the Start Menu shortcut, which Windows requires
|
|
# before it honors an unpackaged app's toast identity (otherwise the toast
|
|
# backend falls back to PowerShell's). 0.58 is already in the tree via gpui.
|
|
windows = { version = "0.58", features = [
|
|
"Data_Xml_Dom",
|
|
"Foundation",
|
|
"UI_Notifications",
|
|
"Win32_Foundation",
|
|
"Win32_Storage_EnhancedStorage",
|
|
# IShellLinkW::GetPath takes a WIN32_FIND_DATAW, so reading an existing
|
|
# shortcut's target back — which is how `aumid` decides whether it has to
|
|
# write at all — needs the file-system bindings too.
|
|
"Win32_Storage_FileSystem",
|
|
"Win32_System_Com",
|
|
"Win32_System_Com_StructuredStorage",
|
|
"Win32_System_Variant",
|
|
"Win32_UI_Shell",
|
|
"Win32_UI_Shell_PropertiesSystem",
|
|
] }
|
|
|
|
# Embeds `assets/favicon.ico` into the `.exe` so Windows shows the tty7 logo in
|
|
# the taskbar / window / Explorer (macOS gets its icon from the `.app` bundle via
|
|
# bundle.sh instead). Only needed at build time on Windows — see build.rs.
|
|
[target.'cfg(windows)'.build-dependencies]
|
|
winresource = "0.1"
|
|
|
|
# gpui only *reads* the macOS window appearance; it never sets it. We force the
|
|
# app appearance to match the active theme (see `ui::theme::sync_native_appearance`)
|
|
# so the native traffic-light buttons render in the right light/dark style.
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
# CFStringTokenizer FFI for dictionary-based CJK word segmentation on
|
|
# double-click (`terminal::smart_select`). Already in the tree transitively,
|
|
# and it makes jieba unnecessary here — see the non-macos section below.
|
|
core-foundation = "0.10"
|
|
objc2 = "0.6"
|
|
objc2-app-kit = { version = "0.3", features = ["NSApplication", "NSResponder", "NSAppearance", "NSGraphics", "NSImage"] }
|
|
# NSData feeds the runtime Dock icon for bare (non-bundled) binaries — see
|
|
# `set_dock_icon_for_bare_binary` in main.rs.
|
|
objc2-foundation = { version = "0.3", features = ["NSData"] }
|
|
# Clickable desktop notifications on macOS. `notify-rust` already pulls this
|
|
# crate transitively for basic display; we depend on it directly to use
|
|
# wait_for_click / NotificationResponse::Click.
|
|
mac-notification-sys = "0.6"
|
|
|
|
# Dictionary-based Chinese word segmentation for double-click selection
|
|
# (`terminal::smart_select`), as a *fallback* where the OS has no tokenizer of
|
|
# its own. macOS is excluded on purpose: CFStringTokenizer segments Chinese
|
|
# about as well (and Japanese/Korean far better) at zero cost, while jieba's
|
|
# table costs ~55 MB resident once built and ~2 MB of binary for the embedded
|
|
# dictionary. Keeping the dep off macOS means that dictionary isn't even
|
|
# linked into the build that can't use it.
|
|
[target.'cfg(not(target_os = "macos"))'.dependencies]
|
|
jieba-rs = "0.10"
|
|
|
|
# x11/wayland are the Linux windowing backends; only pull them on Linux. The
|
|
# Windows backend (`gpui_windows`) and macOS backend are selected by gpui_platform
|
|
# itself via `cfg`, so no feature is needed for them.
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
gpui_platform = { workspace = true, features = ["x11", "wayland"] }
|
|
# Linux tray (`ui::tray`): pure-Rust StatusNotifierItem over DBus (zbus — already
|
|
# in the tree). `blocking` + `async-io` gives a synchronous handle without
|
|
# requiring the app to own a tokio runtime; ksni runs its own service thread. On
|
|
# desktops without an SNI host (bare GNOME without the AppIndicator extension)
|
|
# spawning fails and the tray is silently absent — the app is unaffected.
|
|
ksni = { version = "0.3.6", default-features = false, features = ["blocking", "async-io"] }
|
|
|
|
# gpui's `test-support` unlocks `#[gpui::test]` + `TestAppContext`, the headless
|
|
# App/Window harness the view/event tests run on. Dev-only: the feature merges
|
|
# into test builds and never reaches a release binary.
|
|
[dev-dependencies]
|
|
gpui = { workspace = true, features = ["test-support"] }
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
updater = ["dep:async_zip"]
|
|
|
|
# ---- Standalone workspace mirroring gpui-component's pins so the git/source
|
|
# ---- caches are shared and versions stay aligned. ----
|
|
[workspace]
|
|
members = ["crates/*"]
|
|
# The root `tty7` package is a member implicitly; naming every crate here is
|
|
# what makes a bare `cargo build` / `cargo test` at the root cover the whole
|
|
# workspace, which is how CI invokes them.
|
|
default-members = [".", "crates/tty7-core", "crates/tty7-server", "crates/tty7-cli"]
|
|
|
|
[workspace.package]
|
|
edition = "2024"
|
|
# The single version for all three crates — `tty7`, `tty7-core`, `tty7-server`
|
|
# all inherit it with `version.workspace = true`. They ship together and a
|
|
# client talking to a server of a different build has to be able to say so, so
|
|
# they must never drift apart. This is the line a release bump edits (and the
|
|
# one nightly's `awk '/^version = /'` stamps: it is the first such line in the
|
|
# file, since the package entries above are all `version.workspace = true`).
|
|
version = "26.8.3"
|
|
|
|
[workspace.dependencies]
|
|
# Our fork's `tty7` branch carries the local customizations tty7 relies on:
|
|
# `PopupMenu::with_size`, the 1px hairline menu separator, and the custom-button
|
|
# label color the chrome tiles need. The exact commit is still pinned by
|
|
# Cargo.lock. For co-developing the UI crate, point these back at a sibling
|
|
# checkout: `path = "../gpui-component/crates/{ui,assets}"` — but never commit
|
|
# that, since a path dependency can't resolve on CI.
|
|
#
|
|
# `tree-sitter-languages` compiles the grammars the code editor highlights with.
|
|
gpui-component = { git = "https://github.com/l0ng-ai/gpui-component", branch = "tty7", version = "0.5.2", features = [
|
|
"tree-sitter-languages",
|
|
] }
|
|
gpui-component-assets = { git = "https://github.com/l0ng-ai/gpui-component", branch = "tty7", version = "0.5.1" }
|
|
|
|
gpui = { git = "https://github.com/zed-industries/zed", rev = "1d217ee39d381ac101b7cf49d3d22451ac1093fe" }
|
|
# Base features are cross-platform (`font-kit`, `runtime_shaders` only map to the
|
|
# macOS backend; they're no-ops elsewhere). The Linux-only `x11`/`wayland`
|
|
# backends are added by the `cfg(target_os = "linux")` dependency entry in the
|
|
# package manifest, so they never reach the Windows/macOS builds.
|
|
gpui_platform = { git = "https://github.com/zed-industries/zed", rev = "1d217ee39d381ac101b7cf49d3d22451ac1093fe", features = ["font-kit", "runtime_shaders"] }
|
|
|
|
# Our fork of Zed's alacritty_terminal fork: the VT parser + grid
|
|
# (`Term`/`ansi::Processor`). Two packages read it and they must agree, hence
|
|
# this being a workspace pin rather than one each — the GUI (`terminal::remote`)
|
|
# to render the live mirror, and tty7-cli to turn a captured pane back into text
|
|
# (`tty7 capture --plain`). The daemon parses nothing; it is a byte pipe, and its
|
|
# PTY is driven by `portable-pty`.
|
|
#
|
|
# The `tty7` branch is Zed's `fcf32fe` (the rev Zed pins) plus two commits, both
|
|
# still missing from alacritty master as of 852e971:
|
|
#
|
|
# 1. `push_keyboard_mode` capped its stack by removing from `title_stack` instead
|
|
# of `keyboard_mode_stack` — a copy-paste slip from `push_title` that compiles
|
|
# because both are `Vec`s. With `kitty_keyboard` on (see
|
|
# `terminal_config_from_user`) every overflowing push silently drops a saved
|
|
# title, and once the title stack is empty `Vec::remove(0)` panics — 4097
|
|
# unpopped `CSI > 1 u` pushes, about 20KB of output, kill the reader thread and
|
|
# freeze the pane.
|
|
# 2. `input` reserves columns per `char`, so an emoji written as base + U+FE0F
|
|
# (`❤️`, `🗂️`, `⚠️` — any base whose East Asian Width is Neutral) gets one
|
|
# column instead of two and shifts the rest of the line left by one. The fork
|
|
# re-scores the sequence with `UnicodeWidthStr` and widens the cell (issue
|
|
# #203).
|
|
#
|
|
# Each patch has a guard test in `src/terminal/remote.rs`; drop this fork once
|
|
# both land upstream.
|
|
alacritty_terminal = { git = "https://github.com/l0ng-ai/alacritty", rev = "1276f128fbaa8832cbc66210675cbe8aeb570499" }
|
|
|
|
anyhow = "1"
|
|
log = "0.4"
|
|
serde = { version = "1.0.219", features = ["derive"] }
|
|
serde_json = "1"
|
|
smallvec = "1"
|
|
smol = "2"
|
|
|
|
[patch.crates-io]
|
|
# Temporary until upstream russh releases gssapi-with-mic client auth support
|
|
# (https://github.com/Eugeny/russh/pull/737) — remove this patch and take the
|
|
# crates.io release once it lands. Pinned to an exact rev (never a branch):
|
|
# russh is the SSH protocol layer handling user credentials, and a moving
|
|
# branch on a third-party fork could change what `cargo update` builds.
|
|
russh = { git = "https://github.com/ayamir/russh", rev = "0d1d073350ed823069252075cbf3db9672d5b490" }
|
|
|
|
[workspace.lints.clippy]
|
|
dbg_macro = "deny"
|
|
todo = "deny"
|
|
type_complexity = "allow"
|
|
|
|
[profile.dev]
|
|
codegen-units = 16
|
|
debug = "limited"
|
|
split-debuginfo = "unpacked"
|
|
|
|
[profile.dev.package]
|
|
resvg = { opt-level = 3 }
|
|
rustybuzz = { opt-level = 3 }
|
|
taffy = { opt-level = 3 }
|
|
ttf-parser = { opt-level = 3 }
|
|
smol = { opt-level = 3 }
|
|
gpui = { opt-level = 3 }
|
|
gpui_platform = { opt-level = 3 }
|
|
gpui_macros = { opt-level = 3 }
|
|
# The VT parser + grid run on every PTY byte; at opt-level 0 a `cat bigfile`
|
|
# crawls under `cargo dev`.
|
|
alacritty_terminal = { opt-level = 3 }
|
|
|
|
# The render/parse hot path crosses the tty7 ↔ alacritty_terminal ↔ gpui crate
|
|
# boundaries, so cross-crate inlining (thin LTO, like Zed ships) buys real
|
|
# throughput there; single codegen unit for the same reason.
|
|
[profile.release]
|
|
lto = "thin"
|
|
codegen-units = 1
|
|
|
|
# ---- gpui fork ------------------------------------------------------------
|
|
# Our `tty7` branch (cut from the pinned upstream rev, three commits on top) carries:
|
|
#
|
|
# 1. `prefers_ime_for_printable_keys` takes the keystroke, so an input handler can
|
|
# answer per key instead of per view. tty7 needs it for Option-as-Meta — macOS
|
|
# routes ⌥-chords to the IME whenever a CJK input source is active, and without
|
|
# the keystroke there is no way to decline just those chords (see
|
|
# `terminal::input::prefers_ime_for_printable_keys`, issue #177).
|
|
#
|
|
# 2. gpui's Windows backend rasterizes a font-fallback run with the face
|
|
# DirectWrite actually shaped it with, instead of re-deriving one from the
|
|
# face's family/weight/style. The round trip mapped DirectWrite's italic to
|
|
# oblique, so italic CJK — which every pane reaches through the fallback chain,
|
|
# Hack having no CJK — drew a *different* face's outlines at the shaped glyph
|
|
# indices. Every character rendered as an unrelated character, one for one,
|
|
# which reads as mojibake rather than as a font bug.
|
|
#
|
|
# 3. resvg/usvg bumped 0.45 → 0.47 so gpui's SVG stack unifies with the resvg
|
|
# tty7 pins directly above (follow-up to the #227 dependabot bump).
|
|
#
|
|
# Patching by source rather than editing the `gpui`/`gpui_platform` pins above is
|
|
# deliberate: `gpui-component` declares its own `gpui` from the upstream URL, and
|
|
# a plain pin swap would put two incompatible copies of gpui in the tree. `[patch]`
|
|
# rewrites the source for every dependent at once, so the fork's sibling crates
|
|
# (`gpui_macos`, `gpui_web`, …) come along through their in-repo path deps.
|
|
#
|
|
# When bumping the upstream rev: rebase the fork's `tty7` branch onto the new rev,
|
|
# push, then update the `rev` pins above — the branch here follows automatically.
|
|
[patch."https://github.com/zed-industries/zed"]
|
|
gpui = { git = "https://github.com/l0ng-ai/zed", branch = "tty7" }
|
|
gpui_platform = { git = "https://github.com/l0ng-ai/zed", branch = "tty7" }
|
|
gpui_macros = { git = "https://github.com/l0ng-ai/zed", branch = "tty7" }
|
|
gpui_web = { git = "https://github.com/l0ng-ai/zed", branch = "tty7" }
|
|
reqwest_client = { git = "https://github.com/l0ng-ai/zed", branch = "tty7" }
|