jesseduffield.lazygit/pkg/integration/tests/misc
Stefan Haller b76c1072ff Offer direnv .envrc approval from inside lazygit
When a user switches into a repo whose .envrc hasn't been approved with
`direnv allow`, the previous behavior was to drop a "blocked" error
popup and leave the user to fix it externally. That meant opening a
terminal, running `direnv allow`, and then either restarting lazygit or
switching repos and back to refresh the env — easy to get wrong, easy
to forget.

When `direnv export json` exits non-zero, follow up with `direnv status
--json` to ask direnv whether the current directory has a not-yet-
allowed .envrc, and if so, get its path. Then show a confirmation popup
with the .envrc contents inline so the user can read what they're
approving. Confirming runs `direnv allow <path>` and re-runs the load
so the new env reaches subprocesses immediately; cancelling leaves the
env unloaded (the same state as before this commit when direnv refused
to load the .envrc).

Using `direnv status --json` instead of parsing the "is blocked"
stderr line means we rely on direnv's structured output rather than
its human-readable error format, which is more stable across versions
and avoids assumptions about output formatting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-04 09:05:01 +02:00
..
confirm_on_quit.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
copy_confirmation_message_to_clipboard.go Add "CopyToClipboard" command to ConfirmationController 2025-08-15 17:17:06 +02:00
copy_to_clipboard.go Cleanup: remove unnecessary code in test 2025-08-15 17:17:06 +02:00
direnv_approves_envrc.go Offer direnv .envrc approval from inside lazygit 2026-06-04 09:05:01 +02:00
direnv_loaded_on_repo_switch.go Load direnv environment when switching repos 2026-06-04 09:05:01 +02:00
direnv_unloads_on_blocked_envrc.go Offer direnv .envrc approval from inside lazygit 2026-06-04 09:05:01 +02:00
initial_open.go Use getters for AppState and UserConfig instead of accessing the fields directly 2024-08-18 10:24:52 +02:00
recent_repos_on_launch.go [DATALAD RUNCMD] run codespell throughout fixing typos automagically 2024-08-27 18:03:00 +02:00