Skip to content

fix(gpui): honor CLI --hold for the launched terminal pane - #1102

Open
Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:fix/oss20-20261124-04c7-pebrel-hold-exit
Open

Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:fix/oss20-20261124-04c7-pebrel-hold-exit

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Result / 用户结果

pebrel --hold -e cmd.exe /c echo hello now keeps the GPUI pane and its output after the child exits. Ordinary launches still close, and the retained pane can be closed explicitly. Fixes #1098.

Design / 设计边界

  • Carry the existing CLI option through initial-window startup and elevated handover to a private, ephemeral terminal-view flag. The workspace records the Runtime exit event before retaining the view; a successful held command is not classified as a failed startup.
  • Elevated launches reused by an existing window retain only their own pane. Splits, new tabs and saved sessions do not inherit the option. Plain --hold launches one configured terminal instead of restoring a saved workspace; it bypasses ordinary resident handover, whose public Runtime API has no hold field.
  • Missing hold in elevated wire requests defaults to false; false is omitted when serializing. Old receivers reject a true flag instead of silently accepting the wrong lifetime. Hold cannot be combined with update-restoration requests.
  • No dependencies, workers, persistent settings or public Runtime API changes. The launch-lifetime rationale and rejected alternatives are in architecture/notes/pebrel_app/gpui_shell/workspace/windowing/2026-11-25-cli-hold-lifetime.md.

Evidence / 验证依据

On Windows x64, Rust 1.97.1, base 76f74be1:

  • Native GPUI test binary (--features gpui-test-support), serial execution: windowing 56 passed, 1 ignored; terminal activity 16 passed; elevated handover 6 passed. These cover CLI propagation, retained painted output, success/nonzero exits, Runtime exit records, explicit close, ordinary-pane isolation, elevated reuse and wire compatibility.
  • Controlled regression check: restoring only the old workspace exit predicate makes both new held-exit tests fail. Restoring the fix makes all 16 terminal-activity tests pass. This is a targeted old-behavior mutation, not a claim of testing a pristine baseline build.
  • Actual GPUI application, copied to an isolated probe directory with an isolated configuration: a real cmd.exe /d /c script prints a marker and exits. Without hold the process exits successfully; with hold it remains open and pebrel ctl read returns the marker. Runtime snapshot includes the exit event, and ctl close-window closes the retained pane/window and exits the process successfully.
  • python scripts/check_architecture.py --base 76f74be1 and the three required governance unittest modules: passed (62 tests), without budget changes.
  • cargo test --manifest-path tools/i18n-contract/Cargo.toml --locked: 24 passed, 1 ignored; cargo test -p pebrel-settings --locked: 110 passed; cargo test -p pebrel --test file_line_budget --locked: 2 passed.
  • cargo fmt --all -- --check, cargo check -p pebrel --bin pebrel --features gpui-shell --tests --locked, and cargo build -p pebrel --bin pebrel --features gpui-shell --locked: passed. Existing compiler warnings remain.

The full application suite and Linux/macOS native execution were not run locally. Elevated reuse has GPUI/wire coverage; real UAC cross-process forwarding was not exercised. No new controls or UI strings were added; the real probe checks retained terminal output and explicit closure, not a complete DPI/theme visual matrix. Hosted CI and maintainer review remain separate requirements.

Required Review / 必须确认

  • Followed CONTRIBUTING.md, architecture and project constraints.
  • Existing startup, view-lifetime and exit-routing owners carry the change; no duplicate domain rule was introduced.
  • Architecture check passes without inflated budgets.
  • Success/failure coverage and platform limitations are stated.
  • No new UI messages or placeholders.
  • No governance contract changes.

@Aschenbath
Aschenbath requested a review from Kuddev as a code owner November 24, 2026 16: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.

[Bug] Windows 默认 GPUI 模式下 --hold 参数不生效,-e 子进程退出后窗格/窗口直接关闭

1 participant