[Bug] Nix error when using ! in opencode #4006

Open
opened 2026-02-16 17:42:16 -05:00 by yindo · 4 comments
Owner

Originally created by @suse-coder on GitHub (Dec 30, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

I have a vscode dev container (ubuntu) with nix feature. When I run nix develop (with direnv automatically) it works in the shell that i can run the commands like: just or bun, but when I start opencode (from nix) it works only when it calls it, but when I do ! in opencode -> then the command it gives error:

Image

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @suse-coder on GitHub (Dec 30, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description I have a vscode dev container (ubuntu) with nix feature. When I run nix develop (with direnv automatically) it works in the shell that i can run the commands like: just or bun, but when I start opencode (from nix) it works only when it calls it, but when I do ! in opencode -> then the command it gives error: <img width="486" height="434" alt="Image" src="https://github.com/user-attachments/assets/4424403a-da07-4387-a71a-1554ed02f993" /> ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the help-wantedbugnix labels 2026-02-16 17:42:16 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 30, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4968: Shell sessions losing $PATH value from parent shell
  • #5190: Tighten shell validation in bash.ts to handle shells installed in non-standard paths
  • #4351: Shell ! command does not honour my local aliases

These issues all relate to shell environment and PATH inheritance problems when using the ! command in opencode, which appears to be the core issue you're experiencing with nix develop environments.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 30, 2025): This issue might be a duplicate of existing issues. Please check: - #4968: Shell sessions losing $PATH value from parent shell - #5190: Tighten shell validation in bash.ts to handle shells installed in non-standard paths - #4351: Shell ! command does not honour my local aliases These issues all relate to shell environment and PATH inheritance problems when using the ! command in opencode, which appears to be the core issue you're experiencing with nix develop environments. Feel free to ignore if none of these address your specific case.
Author
Owner

@suse-coder commented on GitHub (Dec 30, 2025):

Seems like the Path is lost:

Image

vs:

Image
@suse-coder commented on GitHub (Dec 30, 2025): Seems like the Path is lost: <img width="580" height="326" alt="Image" src="https://github.com/user-attachments/assets/83aa4546-60c0-4879-a617-937a4ef2a2dd" /> vs: <img width="594" height="270" alt="Image" src="https://github.com/user-attachments/assets/d0b3456c-a8eb-4aa3-b11e-d3aa7269a797" />
Author
Owner

@repairman29 commented on GitHub (Jan 9, 2026):

Hi! I'm interested in contributing to this. Let me know if you'd like to discuss the implementation approach.

(Connected through Echeo)

@repairman29 commented on GitHub (Jan 9, 2026): Hi! I'm interested in contributing to this. Let me know if you'd like to discuss the implementation approach. *(Connected through [Echeo](https://echeo.io))*
Author
Owner

@rekram1-node commented on GitHub (Jan 9, 2026):

@repairman29 pr welcome or if u wanna make a proposal first go ahead

@rekram1-node commented on GitHub (Jan 9, 2026): @repairman29 pr welcome or if u wanna make a proposal first go ahead
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4006