Skip to content

fix(desktop): start local terminals in user home - #1316

Merged
skevetter merged 1 commit into
mainfrom
fix/investigate-terminal-cwd
Sep 29, 2026
Merged

skevetter merged 1 commit into
mainfrom
fix/investigate-terminal-cwd

Conversation

@skevetter

@skevetter skevetter commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Start local Desktop terminal sessions in the user's home directory instead of inheriting Electron's launch directory.
  • Add regression coverage for the PTY spawn cwd and platform-specific shell selection.
  • Keep SSH terminal cwd behavior unchanged.

Validation

  • npm test -- --run src/main/__tests__/pty.test.ts
  • npm run check
  • biome check src/main/__tests__/pty.test.ts
  • Local CodeRabbit review completed; one Windows-specific test expectation finding was fixed.

Summary by CodeRabbit

  • Bug Fixes
    • Terminal sessions now start in the user’s home directory, making the initial working location consistent across platforms.
    • Session startup continues to use the platform-appropriate shell, with a fallback shell on non-Windows platforms.

@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 2ac8a48
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6abb54754f848c000853bceb

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: afede8d8-f468-4432-be3c-dd0ebdd0d4a8

📥 Commits

Reviewing files that changed from the base of the PR and between 59f51ce and 2ac8a48.

📒 Files selected for processing (2)
  • desktop/src/main/__tests__/pty.test.ts
  • desktop/src/main/pty.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The PTY manager now accepts an optional spawn implementation and starts sessions in the user's home directory. A test checks the shell selection and spawn options for an 80-by-24 session.

Changes

PTY session setup

Layer / File(s) Summary
Spawner injection and session configuration
desktop/src/main/pty.ts, desktop/src/main/__tests__/pty.test.ts
PtyManager uses the injected spawnPty implementation when provided and otherwise loads node-pty. Sessions start in homedir(). The test checks the selected shell, arguments, home directory, and dimensions.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 2ac8a

No issue identified here prevents merging after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 2ac8a

Local terminals now start in the user’s home directory. The reviewed production path does not let a terminal request choose that directory or replace the process spawner. No new security concern was identified, though coverage is not complete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The new working-directory option applies to local shell creation; the separate SSH-session spawn path remains without that option.

Trust Boundaries and Controls

  • inferred — The reviewed terminal-create path does not provide a renderer-controlled spawner or working-directory value: it forwards dimensions, and production construction omits the optional spawner.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: starting local Desktop terminal sessions in the user’s home directory.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 2ac8a48
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6abb5475914b1e0009a89072

@skevetter
skevetter marked this pull request as ready for review September 29, 2026 06:30
@mergify

mergify Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@skevetter
skevetter merged commit 31660f3 into main Sep 29, 2026
32 checks passed
@skevetter
skevetter deleted the fix/investigate-terminal-cwd branch September 29, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant