Skip to content

fix(tui): launch lazygit and other cwd-based editors correctly (#23) - #41

Merged
Bharath-code merged 1 commit into
mainfrom
fix/23-editor-launch
Sep 26, 2026
Merged

Bharath-code merged 1 commit into
mainfrom
fix/23-editor-launch

Conversation

@Bharath-code

Copy link
Copy Markdown
Owner

Fixes the launch half of #23.

Problem

Editors were run as <editor> <repo-path>. lazygit parses a positional arg as a subcommand (status, log, …), so it exited with Invalid git arg value: '<path>'.

Change

  • New editorArgs/editorCmd in internal/tui/editor.go:
    • {path} token in editor: is substituted (e.g. lazygit --path {path}).
    • Bare lazygit / gitui / tig get no positional path; they open the repo via cwd.
    • Otherwise the path is appended as before, so code, nvim, and the lazygit --path workaround still work.
    • Every editor now runs with cmd.Dir = repo.
  • README documents {path}.
  • Table-driven tests incl. Windows .exe path and the legacy --path form.

Not covered here

  • Relaunch after quitting lazygit on Windows: no state bug found in our Update loop; likely bubbletea 0.26's Windows input restore after ExecProcess. chore(deps): bump the gomod group with 4 updates #38 moved us to bubbletea 1.3.10. Needs reporter confirmation on Windows.
  • shell.Fields treats \ as escape, so editor: C:\tools\lazygit.exe may mangle; use forward slashes or a PATH name.

Test plan

  • go test -race ./..., go vet ./...
  • GOOS=windows go build ./...
  • Manual: editor: lazygit, Enter on 3 repos in one session (Windows + macOS)

🤖 Generated with Claude Code

Bare lazygit/gitui/tig now run in the repo dir without a positional path
(lazygit parsed it as a subcommand). Editors support a {path} token, and
every editor starts with cwd set to the repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kilo-code-bot

kilo-code-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown

Kilo Code Review could not run — your account is out of credits.

Add credits or switch to a free model to enable reviews on this change.

@Bharath-code
Bharath-code merged commit 55b3213 into main Sep 26, 2026
3 of 4 checks passed
@Bharath-code
Bharath-code deleted the fix/23-editor-launch branch September 26, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant