From 1b62f0bddc639a9b30ff95ea2326e52f9b1e7528 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 10 Feb 2026 09:17:40 +0200 Subject: Fix hexai-tmux-edit to open in current working directory hexai-tmux-edit was opening in the wrong directory because the tmux popup wasn't being told which directory to use. This fix: - Updates bind-key example to cd into pane's current path - Passes working directory to popup via -d flag using os.Getwd() - Updates all documentation with corrected bind-key examples Co-Authored-By: Claude Sonnet 4.5 --- internal/tmuxedit/run.go | 11 +++++++++-- internal/version.go | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'internal') diff --git a/internal/tmuxedit/run.go b/internal/tmuxedit/run.go index f81eb64..8c98ded 100644 --- a/internal/tmuxedit/run.go +++ b/internal/tmuxedit/run.go @@ -58,10 +58,17 @@ var openEditorPopup = func(initial, popupW, popupH string) (string, error) { } // launchPopup is the seam for running `tmux display-popup` with the editor. -// The -E flag makes the popup close when the editor exits. Uses .Run() -// (not .Output()) so the popup blocks until the user closes the editor. +// The -E flag makes the popup close when the editor exits. The -d flag sets +// the working directory for the popup. Uses .Run() (not .Output()) so the +// popup blocks until the user closes the editor. var launchPopup = func(ed, path, width, height string) error { args := []string{"display-popup", "-E"} + + // Get current working directory to pass to the popup + if cwd, err := os.Getwd(); err == nil && cwd != "" { + args = append(args, "-d", cwd) + } + if width != "" { args = append(args, "-w", width) } diff --git a/internal/version.go b/internal/version.go index 50b476f..027fd1f 100644 --- a/internal/version.go +++ b/internal/version.go @@ -1,4 +1,4 @@ // Summary: Hexai semantic version identifier used by CLI and LSP binaries. package internal -const Version = "0.18.2" +const Version = "0.18.3" -- cgit v1.2.3