fix(tab) Fix tab config cwd being dropped for missing directories#9724
fix(tab) Fix tab config cwd being dropped for missing directories#9724doubledare704 wants to merge 1 commit intowarpdotdev:masterfrom
Conversation
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I reviewed this pull request and requested human review from: @vkodithala. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR preserves the tab config directory value when constructing terminal and agent panes, allowing lower-level shell startup/bootstrap handling to receive the configured cwd even when it does not exist yet. The added regression test covers the pane-template path and asserts the startup path remains available on the terminal model.
Concerns
- No blocking correctness or security concerns found in the changed lines. Local Unix startup passes the path through
WARP_INITIAL_WORKING_DIRand starts the process from home; Windows still filterslpCurrentDirectorywithis_dir()while passing the bootstrap env var, so invalid paths should not become unsafe process cwd values.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
Description
Preserves the
directory/cwd value from tab configs when creating terminal and agent panes, even if the directory does not exist yet.Previously,
pane_groupfiltered the configured cwd withp.exists(). When the directory was missing at tab creation time, Warp silently discarded the tab config cwd and fell back to the default startup directory, making the tab config field appear ignored.This change removes that early existence check so the configured cwd is still passed into session startup. Lower-level platform-specific startup behavior remains responsible for handling invalid process cwd values. In particular, the Windows PTY path still guards
CreateProcessWwith anis_dir()check before passinglpCurrentDirectory, so this should preserve the existing Windows spawn safety while keeping the tab config intent available to shell/bootstrap handling.Open technical questions for review:
directoryalways be treated as user intent, even when the path does not exist yet, or should Warp intentionally drop missing paths before shell startup?CreateProcessWis_dir()fallback the right place to keep spawn safety, instead of filtering tab config cwd earlier inpane_group?My current read is that
pane_groupshould preserve the configured cwd, while lower-level PTY/bootstrap code should decide how each platform handles missing or invalid directories.Linked Issue
Closes #9130
ready-to-specorready-to-implement.Screenshots / Videos
Not applicable; this is startup behavior with no UI changes.
Testing
Added a regression test covering a tab config pane whose configured cwd does not exist. The test asserts the non-existent cwd is still preserved as the terminal model startup path.
Ran:
cargo test -p warp test_tab_config_preserves_nonexistent_cwdcargo test -p warp pane_group::testscargo test -p warp working_directoriescargo test -p warp tree::testsAgent Mode
Changelog Entries for Stable
CHANGELOG-BUG-FIX: Fixed tab configs silently ignoring configured directories that do not exist yet.