Skip to content

fix: preserve nix/direnv PATH in login shell for ! commands - #24246

Closed
xthreehao wants to merge 1 commit into
anomalyco:devfrom
xthreehao:fix/login-shell-path
Closed

xthreehao wants to merge 1 commit into
anomalyco:devfrom
xthreehao:fix/login-shell-path

Conversation

@xthreehao

@xthreehao xthreehao commented Apr 25, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #6468

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

I added a small workaround in the shell invocation: I save $PATH first, then source profiles, then put the saved PATH back in front with export. It's simple and doesn't change the rest of the shell behavior.

How did you verify your code works?

  1. Entered a Nix dev environment (nix develop or direnv) where just and bun are available.
  2. Launched OpenCode inside this environment.
  3. Executed !which just and !just --version via the TUI. Before the fix, these failed; after the fix, they succeed.
  4. Tested in a normal (non‑Nix) terminal with !ls and !echo $PATH to ensure no regression.

Screenshots / recordings

N/A (no UI changes).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node

Copy link
Copy Markdown
Collaborator

Can you provide more evidence for before and after, I havent heard of this issue in a long long time

@xthreehao

Copy link
Copy Markdown
Author

Yes, the related issue #6468 is still open, which indicates the problem hasn't been fully resolved yet. My PR addresses exactly what was reported there.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@rekram1-node

Copy link
Copy Markdown
Collaborator

That is insufficient, there are 0 other recent reports of the issue, I would like evidence it still exists otherwise im inclined to close issue and your pr.

If it still happens please provide exactly how you reproduced ideally with a video and show that your fix actually works as well please

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 25, 2026
@github-actions github-actions Bot closed this Apr 25, 2026
@xthreehao
xthreehao deleted the fix/login-shell-path branch April 25, 2026 07:03
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.

[Bug] Nix error when using ! in opencode

2 participants