core: forward cwd through BlitWorkspace.createSession#87
Merged
Conversation
BlitConnection.createSession and the CREATE2 wire message already accept a cwd, but BlitWorkspace.createSession dropped it, so callers using the workspace API couldn't open a session in a chosen directory. Add cwd to CreateWorkspaceSessionOptions and forward it. Co-authored-by: Indent <noreply@indent.com>
|
🔗 Preview: https://blit-r973k5vcv-indent.vercel.app |
Coverage
|
pcarrier
reviewed
Jul 24, 2026
| tag?: string; | ||
| command?: string; | ||
| cwdFromSessionId?: SessionId; | ||
| /** Working directory for the new session. Interpreted on the target server. */ |
Contributor
There was a problem hiding this comment.
I don't think this needs a comment.
Co-authored-by: Indent <noreply@indent.com>
pcarrier
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
BlitWorkspace.createSessiondroppedcwd:CreateWorkspaceSessionOptionsdidn't expose the field, even though the lower-levelBlitConnection.createSessionand theCREATE2wire message already accept acwd(working directory interpreted on the target server). Callers using the workspace-level API therefore couldn't open a new session in a chosen directory — every session inherited the blit server process's cwd.This adds
cwd?: stringtoCreateWorkspaceSessionOptionsand forwards it toconnection.createSession.Why
In neo, the web terminal opens PTYs through
BlitWorkspace.createSession. On local (desktop) computers a single shared blit server serves every session, and its cwd is whatever the Electron main process inherited (/), so new terminals open at/instead of the user's chosen workspace directory. With this field, neo can pass the session's workspace path per-terminal and open each one in the right place, without spawning a server per session.Testing
Type-safe passthrough;
cwdmirrors the existingCreateSessionOptions.cwdonBlitConnection, whose wire encoding is already covered byBlitConnection.test.ts("createSession with cwd sets features").Tag
@indentto continue the conversation here.