Closed howarddo2208 closed 1 year ago
I changed to 0.5 and it worked again, I think this line leads to the problem on my machine, any input? https://github.com/chisui/zsh-nix-shell/blob/1834762686241fb3a842d179f1a0712cffa8f7d3/nix-shell.plugin.zsh#L64
Same here. I am on ARM darwin. Running readlink /proc/$$/exe
produces no output. I would suggest changing the name of the issue, though, it is confusing right now.
nix-shell not found
is not really what's happening, the error is --stdin: command not found
oh yeah, I figured as I don't see temp nix-shell, I changed to that
So, 0.6 is broken on darwin because there is no /proc
on MacOS. @chisui
Would it make sense to simply do which zsh
or readlink -f $(which zsh)
?
This plugin is developed primarily for use in NixOs. In NixOs you don't have to expose your shell through PATH
so which zsh
might fail. For Mac support I have to rely on the community since I don't have access to a Mac machine. I will try to find an alternative to /proc
for Mac. PRs are more than welcome on this issue though.
@howarddo2208 @gshpychka does ps -p $$ -o command | tail +2
print the path to the currently running zsh
? If so I could use that for both Mac and linux.
@howarddo2208 @gshpychka does
ps -p $$ -o command | tail +2
print the path to the currently runningzsh
? If so I could use that for both Mac and linux.
No, it prints "-zsh" on my machine.
same here
An if you use bsd style arguments? ps p $$ o command
An if you use bsd style arguments?
ps p $$ o command
That doesn't work: ps: illegal argument: o
How's this:
lsof -p $$ | awk '$4=="txt" {print $9}' | head -n 1
?
I pushed an potential fix to master. Let me know if that fixes your this issue. If it does, I'll create a new release
Hm, no, same error. I guess the detection logic isn't working as expected?
With the help of a friends Mac I debugged parts of the script. Does the current version on master work now?
yeah, it works now, thank you!
Issue description
I'm trying this plugin out, but ran to an issue upon running
nix-shell
Output:/private/tmp/nix-shell-20000-0/rc: line 4: --stdin: command not found
I tried to find the file, it doesn't existDid you install the plugin according to the installation guide? If not, does the issue persist if you do install it that way? Yes, at first, my installation was with zsh-zap, but after that, I changed to plain zsh but still doesn't work
Steps to reproduce
shell.nix
in a project, i.ewith pkgs;
mkShell { buildInputs = [ cowsay ]; }
"x86_64-darwin"
Darwin 22.4.0, macOS 10.16
yes
no
nix-env (Nix) 2.15.0
"nixpkgs"
/nix/var/nix/profiles/per-user/root/channels/nixpkgs