Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/features/board/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Requirements: `tmux` and `git` must be installed.
| `n` | Create a card (project + prompt) |
| `enter` | Attach to the card's agent (`ctrl+q` detaches) |
| `d` | View the card's worktree diff |
| `o` | Open the card's worktree in `$BOARD_EDITOR` (`code`) |
| `o` | Open the card's worktree in `$DOCKER_AGENT_BOARD_EDITOR` (`code`) |
| `[` / `]` | Move the card back / forward |
| `x` | Delete the card, its session, worktree, and branch |
| `p` | Manage projects |
Expand Down
5 changes: 3 additions & 2 deletions pkg/board/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,14 +349,15 @@ func (a *App) Diff(cardID string) (string, error) {
}

// OpenEditor opens the card's worktree in the user's GUI editor: the
// command named by $BOARD_EDITOR, defaulting to VS Code's `code`. The
// command named by $DOCKER_AGENT_BOARD_EDITOR, defaulting to VS Code's `code`. The
// editor is started detached and reaped in the background.
func (a *App) OpenEditor(cardID string) error {
card, err := a.store.GetCard(cardID)
if err != nil {
return err
}
editor := cmp.Or(os.Getenv("BOARD_EDITOR"), "code")
// BOARD_EDITOR is the legacy name, kept as a fallback for one release.
editor := cmp.Or(os.Getenv("DOCKER_AGENT_BOARD_EDITOR"), os.Getenv("BOARD_EDITOR"), "code")
cmd := exec.CommandContext(a.ctx, editor, card.Worktree)
if err := cmd.Start(); err != nil {
return fmt.Errorf("open editor (%s): %w", editor, err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/board/tmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func setSessionHeader(ctx context.Context, name, title, project, worktree string
wt := shQuote(worktree)
diffCmd := "git -C " + wt + " diff --color=always \"$(git -C " + wt + " merge-base HEAD " +
shQuote(upstreamBase(ctx, worktree)) + " || echo HEAD)\" | less -R"
editorCmd := "${BOARD_EDITOR:-code} " + wt
editorCmd := "${DOCKER_AGENT_BOARD_EDITOR:-${BOARD_EDITOR:-code}} " + wt

right := "#[range=user|diff] diff #[norange]·#[range=user|editor] editor #[norange]·" +
"#[range=right] #[bold]ctrl+q#[nobold] board #[norange]"
Expand Down
2 changes: 1 addition & 1 deletion pkg/board/tui/dialogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (d *helpDialog) View(width, _ int) string {
{keys.New.Help().Key, "create a card (launches an agent in a worktree)"},
{keys.Attach.Help().Key, keys.Attach.Help().Desc},
{keys.Diff.Help().Key, "view the card's worktree diff"},
{keys.Editor.Help().Key, keys.Editor.Help().Desc + " ($BOARD_EDITOR, default code)"},
{keys.Editor.Help().Key, keys.Editor.Help().Desc + " ($DOCKER_AGENT_BOARD_EDITOR, default code)"},
{"[ / ]", "move card (forward sends the column's prompt)"},
{keys.Delete.Help().Key, "delete card, its session and worktree"},
{keys.Projects.Help().Key, keys.Projects.Help().Desc},
Expand Down
Loading