Skip to content

Open the session working directory in the system file manager #197

Description

@jongio

Summary

Add a keybinding that opens the selected session's working directory in the operating system file manager (Explorer on Windows, Finder on macOS, the default handler on Linux).

Problem

The preview pane shows a session's working directory, and F opens individual touched files through the file picker. There is no way to jump straight to the directory itself. When you find the session you care about, the natural next step is often to look at the whole folder in your file manager, and today that means copying the path and opening it by hand.

Proposed solution

Add a new action bound to a free key (for example O, since o is already conversation sort) that opens the selected session's Cwd in the system file manager:

  • Windows: explorer <dir>
  • macOS: open <dir>
  • Linux: xdg-open <dir>

Behavior details:

  • Use the cursor session's Cwd. If it is empty or the directory no longer exists, show a brief status message and do nothing.
  • Reuse the existing platform launch plumbing rather than adding a new spawning path. internal/platform already resolves OS-specific commands; add a small OpenDir (or equivalent) helper there and keep the OS switch in one place.
  • Do not block the UI. Fire the command and return, matching how launches already work.
  • Register the key in keys.go, wire the handler in model.go, and add it to the help overlay groups.

Acceptance criteria

  • Pressing the new key opens the selected session's working directory in the OS file manager on Windows, macOS, and Linux.
  • An empty or missing directory produces a status message and no spawn attempt.
  • The key appears in the help overlay and short help bar.
  • The OS command selection lives behind a platform helper with per-OS unit tests (command name and argument assembled correctly per GOOS).
  • No new keybinding collides with an existing one.

Technical notes

  • Keybindings: internal/tui/keys.go. Handler dispatch: internal/tui/model.go. Help text: internal/tui/components/help.go.
  • OS-specific command resolution belongs in internal/platform.
  • go build ./..., go test ./... -count=1, go vet ./..., then mage preflight.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions