Skip to content

Commit 4f42fc5

Browse files
authored
Merge pull request #3514 from dgageot/rename-board-editor-env-var
chore(board): rename $BOARD_EDITOR to $DOCKER_AGENT_BOARD_EDITOR
2 parents dabd716 + 2565879 commit 4f42fc5

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

docs/features/board/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Requirements: `tmux` and `git` must be installed.
4646
| `n` | Create a card (project + prompt) |
4747
| `enter` | Attach to the card's agent (`ctrl+q` detaches) |
4848
| `d` | View the card's worktree diff |
49-
| `o` | Open the card's worktree in `$BOARD_EDITOR` (`code`) |
49+
| `o` | Open the card's worktree in `$DOCKER_AGENT_BOARD_EDITOR` (`code`) |
5050
| `[` / `]` | Move the card back / forward |
5151
| `x` | Delete the card, its session, worktree, and branch |
5252
| `p` | Manage projects |

pkg/board/app.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,15 @@ func (a *App) Diff(cardID string) (string, error) {
349349
}
350350

351351
// OpenEditor opens the card's worktree in the user's GUI editor: the
352-
// command named by $BOARD_EDITOR, defaulting to VS Code's `code`. The
352+
// command named by $DOCKER_AGENT_BOARD_EDITOR, defaulting to VS Code's `code`. The
353353
// editor is started detached and reaped in the background.
354354
func (a *App) OpenEditor(cardID string) error {
355355
card, err := a.store.GetCard(cardID)
356356
if err != nil {
357357
return err
358358
}
359-
editor := cmp.Or(os.Getenv("BOARD_EDITOR"), "code")
359+
// BOARD_EDITOR is the legacy name, kept as a fallback for one release.
360+
editor := cmp.Or(os.Getenv("DOCKER_AGENT_BOARD_EDITOR"), os.Getenv("BOARD_EDITOR"), "code")
360361
cmd := exec.CommandContext(a.ctx, editor, card.Worktree)
361362
if err := cmd.Start(); err != nil {
362363
return fmt.Errorf("open editor (%s): %w", editor, err)

pkg/board/tmux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func setSessionHeader(ctx context.Context, name, title, project, worktree string
251251
wt := shQuote(worktree)
252252
diffCmd := "git -C " + wt + " diff --color=always \"$(git -C " + wt + " merge-base HEAD " +
253253
shQuote(upstreamBase(ctx, worktree)) + " || echo HEAD)\" | less -R"
254-
editorCmd := "${BOARD_EDITOR:-code} " + wt
254+
editorCmd := "${DOCKER_AGENT_BOARD_EDITOR:-${BOARD_EDITOR:-code}} " + wt
255255

256256
right := "#[range=user|diff] diff #[norange]·#[range=user|editor] editor #[norange]·" +
257257
"#[range=right] #[bold]ctrl+q#[nobold] board #[norange]"

pkg/board/tui/dialogs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ func (d *helpDialog) View(width, _ int) string {
610610
{keys.New.Help().Key, "create a card (launches an agent in a worktree)"},
611611
{keys.Attach.Help().Key, keys.Attach.Help().Desc},
612612
{keys.Diff.Help().Key, "view the card's worktree diff"},
613-
{keys.Editor.Help().Key, keys.Editor.Help().Desc + " ($BOARD_EDITOR, default code)"},
613+
{keys.Editor.Help().Key, keys.Editor.Help().Desc + " ($DOCKER_AGENT_BOARD_EDITOR, default code)"},
614614
{"[ / ]", "move card (forward sends the column's prompt)"},
615615
{keys.Delete.Help().Key, "delete card, its session and worktree"},
616616
{keys.Projects.Help().Key, keys.Projects.Help().Desc},

0 commit comments

Comments
 (0)