Skip to content

fix: honor configured directory for the first terminal - #1089

Open
Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:fix/oss50-20261123-7728-pebrel-startup-directory
Open

Aschenbath wants to merge 1 commit into
Kuddev:mainfrom
Aschenbath:fix/oss50-20261123-7728-pebrel-startup-directory

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Result / 用户结果

The first terminal now starts in the configured startup directory when the launch request has no explicit working directory. An explicit launch directory still takes precedence. Fixes #1081.

Design / 设计边界

The workspace's NewTerminal startup arm now uses the existing cold_start_cwd fallback, matching the established directory policy. No settings format, public interface, dependencies, threading, or lifetime behavior changes. Existing invalid-directory fallback remains owned by cold_start_cwd.

The regression opens the actual GPUI workspace in an isolated child process, checks the configured-directory case and the explicit-directory override, and inspects the first terminal's working directory. It reuses the existing imported-profile fixture to fail native process creation before a PTY reader can enter the deterministic test executor.

Evidence / 验证依据

Validated on native Windows with Rust 1.97.1. Cargo test/check commands used --locked --config .github/ci-profile.toml --profile ci.

  • New regression against unchanged production code: failed on the empty working directory versus the configured path. With the fix: the startup test group passes (11 tests).
  • cargo test ... -p pebrel --bin pebrel --features gpui-test-support gpui_shell::workspace::windowing::startup:: -- --nocapture: passed.
  • python scripts/check_architecture.py --base 76f74be115ec0fa75dca9a9fdaf6e682f83e05f5: passed, retaining existing notices and budgets.
  • python -m unittest scripts.tests.test_architecture_budgets scripts.tests.test_architecture_dependencies scripts.tests.test_architecture_governance: 62 passed.
  • cargo test ... -p pebrel-settings: 110 passed.
  • cargo test --manifest-path tools/i18n-contract/Cargo.toml ...: 24 passed, 1 existing ignored.
  • cargo test ... -p pebrel --test file_line_budget: 2 passed.
  • cargo fmt --all -- --check: passed.
  • cargo check ... -p pebrel --bin pebrel --features gpui-shell --tests: passed.

The full application suite and other operating systems were not run. There is no visual layout, translated-message, or hot-path change; screenshots/DPI measurements are not applicable. The launch-failure fixture makes terminal construction deterministic; it does not claim to exercise a successful interactive shell session.

Required Review / 必须确认

  • I followed CONTRIBUTING.md, docs/architecture.md, and docs/project-constraints.md.
  • I split responsibilities, not arbitrary line ranges; no duplicate behavior authority was added.
  • python3 scripts/check_architecture.py --base <PR-base-commit> passes; budgets were not inflated to fit the change.
  • Tests cover the directory fallback and explicit override through the real workspace/terminal construction path; platform and launch-fixture limitations are stated above.
  • New messages use typed i18n IDs and matching placeholders: not applicable; no new messages.
  • Governance changes include a counterexample, corrected contract, tests, and a maintainer-reviewed decision: not applicable; no governance changes.

Use the existing cold-start directory fallback when NewTerminal has no explicit working directory. Preserve explicit launch paths.

Fixes Kuddev#1081.
@Aschenbath
Aschenbath requested a review from Kuddev as a code owner November 23, 2026 07: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] 管理员/关闭 UAC 隔离冷启动忽略设置的「启动目录」(startup_directory) 并退回快捷方式工作目录

1 participant