From 0148c1379b76c5c0a9d05588c07dcb06ec32f93f Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Fri, 22 May 2026 02:21:12 +0300 Subject: feat: add git worktree workspace management refs #137 --- docs/next/CHANGELOG.md | 1 + docs/next/README.md | 1 + docs/next/website/src/content/docs/configuration.mdx | 20 ++++++++++++++++++++ 3 files changed, 22 insertions(+) (limited to 'docs') diff --git a/docs/next/CHANGELOG.md b/docs/next/CHANGELOG.md index fad2404c..1385fdb0 100644 --- a/docs/next/CHANGELOG.md +++ b/docs/next/CHANGELOG.md @@ -6,6 +6,7 @@ - Added `ui.mouse_scroll_lines` to configure how many pane scrollback lines each mouse wheel notch scrolls. The default remains 3. (#236) - Added `--remote-keybindings local|server` for `herdr --remote`. Remote attach now uses the launching client's local keybindings by default without copying config files to the remote host; use `--remote-keybindings server` to keep the remote server's keybindings. The client/server protocol is now version 9. - Added `experimental.reveal_hidden_cursor_for_cjk_ime = false` (opt-in), `experimental.cjk_ime_agents = []` (optional allow-list), and `experimental.cjk_ime_cursor_shape = "steady_block"` to expose the focused pane's cursor anchor to the outer terminal even when the pane requested `?25l`, restoring macOS IME candidate-window tracking for TUIs that paint their own cursor (Claude Code, pi, codex). When `cjk_ime_agents` is non-empty, the reveal applies only to focused panes whose detected agent matches one of the listed names. When the pane reports no cursor position, the anchor falls back to the pane's top-left so a stable IME hint is always available. Trade-off when enabled: an extra hardware cursor may appear in the outer terminal for apps that hide the cursor without painting a replacement. (#149, thanks @ChihGodlee) +- Added explicit sidebar Git worktree groups plus native worktree creation, existing checkout open, and safe checkout cleanup flows, configured by `[worktrees].directory`, `keys.new_worktree`, optional `keys.open_worktree`, and optional `keys.remove_worktree`. ### Fixed - Antigravity CLI (`agy`) sessions are now detected, and their terminal UI now reports working and blocked states in the Agents panel. (#207) diff --git a/docs/next/README.md b/docs/next/README.md index 53a2a973..2b4683c0 100644 --- a/docs/next/README.md +++ b/docs/next/README.md @@ -212,6 +212,7 @@ press `ctrl+b` to enter prefix mode. default actions are prefix-first and tmux-l | `prefix+1..9` | switch tab | | `prefix+w` | workspace navigation | | `prefix+shift+n` | new workspace | +| `prefix+shift+g` | new worktree | | `prefix+shift+w` | rename workspace | | `prefix+shift+d` | close workspace | | `prefix+h/j/k/l` | focus pane | diff --git a/docs/next/website/src/content/docs/configuration.mdx b/docs/next/website/src/content/docs/configuration.mdx index 9f19d4fd..72dc610c 100644 --- a/docs/next/website/src/content/docs/configuration.mdx +++ b/docs/next/website/src/content/docs/configuration.mdx @@ -56,6 +56,23 @@ default_shell = "nu" When unset or empty, Herdr uses `$SHELL`, then `/bin/sh`. This is an executable name or path, not a shell command line. Existing panes keep their current shell until they are recreated. Command panes still run through `/bin/sh -c`; detached custom command keybindings use Herdr's existing `/bin/sh -lc` path. +## Worktrees + +Set the root directory Herdr uses for Git worktree checkouts created from the sidebar: + +```toml +[worktrees] +directory = "~/.herdr/worktrees" +``` + +Herdr creates checkouts under `//`. For sibling-style checkouts, set this to a directory such as `~/Projects/herdr-worktrees`. + +Worktree actions are available from Git workspace rows. `New worktree` creates a branch and checkout, opens it as a new Herdr workspace, and groups it under the source workspace. `Open worktree...` lists existing Git worktree checkouts for that repo; choosing an already-open checkout focuses it, and choosing a closed checkout opens it in the same group. + +Grouped worktrees still behave like normal Herdr workspaces: they can be focused, renamed, closed, and contain their own tabs and panes. The parent row is the original workspace. Closing the parent row closes the whole Herdr group, but it does not delete checkout folders or branches. + +Deleting a worktree checkout is explicit. Use `Delete worktree checkout...` on a grouped child workspace to run `git worktree remove`. Herdr first asks Git to remove safely. If Git refuses because the checkout has modified or untracked files, Herdr asks again before running the forced remove. Branches are not deleted. + ## Keybindings Herdr has a prefix mode similar to tmux. The default prefix is `ctrl+b`. Keybinding strings are explicit: `prefix+n` means press the configured prefix and then `n`; `ctrl+alt+n` is a direct terminal-mode shortcut. @@ -79,6 +96,7 @@ The default keymap is prefix-first and avoids direct shortcuts that can steal in detach = "prefix+q" workspace_picker = "prefix+w" new_workspace = "prefix+shift+n" +new_worktree = "prefix+shift+g" rename_workspace = "prefix+shift+w" close_workspace = "prefix+shift+d" new_tab = "prefix+c" @@ -105,6 +123,8 @@ Optional actions are unset by default. Bind them with `prefix+` for prefix-mode [keys] previous_workspace = "prefix+shift+left" next_workspace = "prefix+shift+right" +open_worktree = "prefix+shift+o" +remove_worktree = "prefix+alt+d" next_tab = ["prefix+n", "ctrl+alt+]"] ``` -- cgit v1.2.3