Skip to content

feat: option to open a workspace in the launch directory - #2563

Closed
iacore wants to merge 1 commit into
herdrdev:masterfrom
iacore:open-workspace-in-launch-directory
Closed

feat: option to open a workspace in the launch directory#2563
iacore wants to merge 1 commit into
herdrdev:masterfrom
iacore:open-workspace-in-launch-directory

Conversation

@iacore

@iacore iacore commented Aug 9, 2026

Copy link
Copy Markdown

Adds [session] open_workspace_in_launch_directory (default false).

When enabled, running herdr from a directory focuses the workspace for
that directory, or opens a new workspace there when the restored session
has none — instead of always restoring the previous layout. This makes
"open a terminal in the project I'm in" work for a long-running
persistent session.

Implementation summary:

  • The full-app client sends its launch directory in the Hello handshake
    (launch_cwd). Direct terminal attaches and remote attaches send
    None — the local launch directory is meaningless on a remote server.
  • On ClientConnected, the server runs ensure_workspace_for_launch_cwd:
    canonicalized match against each workspace's resolved identity cwd →
    focus it; otherwise create a workspace there (one tab, one shell pane)
    and focus it. Gated on the config flag.
  • The HERDR_STARTUP_CWD daemon-seed hack is removed. It only seeded a
    startup workspace when the restored session was empty, and only when a
    fresh server was spawned. The handshake cwd covers the daemon-spawn path
    too, including non-empty restored sessions.

Tests:

  • open_workspace_in_launch_directory_defaults_off_and_parses
  • client_attach_with_launch_cwd_creates_workspace_there
  • client_attach_with_matching_launch_cwd_focuses_existing_workspace
  • client_attach_with_launch_cwd_skipped_when_config_off
  • client_attach_without_launch_cwd_does_not_create_workspace

Docs updated under docs/next/ (config reference + session-state).

Not covered: an option to always open a new pane even when the workspace
exists; the current behavior focuses the existing workspace to avoid
accumulating panes per attach. Happy to adjust based on maintainer input.


Refs: #2508 (reply in thread)

@kangal-bot

Copy link
Copy Markdown
Collaborator

Hi @iacore, thanks for your interest in contributing.

Herdr does not accept unsolicited implementation pull requests from contributors who are not listed in .github/APPROVED_CONTRIBUTORS.

The pull request author is not an approved contributor.

If you encountered a reproducible bug, report the observed behavior through the bug issue template. A report does not reserve the work or authorize a pull request; accepted fixes are normally implemented by Herdr’s maintainer-controlled agents.

Feature requests, behavior changes, and other proposals belong in GitHub Discussions. Do not open an issue merely to justify an implementation that was already written.

If a maintainer explicitly wants this implementation, they can reopen the pull request. Reopening by anyone else will be closed again automatically.

See https://github.com/herdrdev/herdr/blob/master/CONTRIBUTING.md for the contribution policy.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ad6bb222-a8b9-459b-b038-9623c3452e1b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@kangal-bot kangal-bot closed this Aug 9, 2026
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.

2 participants