Problem description:
If you go into a Repl (afaik any template will work) and type ls -lath /nix/store in the Shell, it freezes. EDIT: not only ls freezes, but any operation that reads from /nix/store freezes. Launching pcmanfm and opening the folder causes it to freeze, opening file:///nix/store in Fierfox causes it to freeze, and also vifm.
Expected behavior:
The expected behavior is that the contents of the folder are listed.
Actual behavior:
The ls command freezes and does not show any output.
Steps to reproduce:
Go into the shell
Write ls /nix/store
Press enter
Bug appears at this link:
Any Repl with a Shell will work.
Just realized this was kinda like an XY problem, sorry.
I installed xterm and it works fine, but if I run a command that is not installed, it just says command not found.
I wanted to launch xterm with the same shell that Replit uses in the shell tab, so I did echo $0 and it shows that the shell is stored in /nix/store/8kgsjv57icc18qhpmj588g9x1w34hi4j-bash-interactive-5.1-p12/bin/bash. But I assume that the path changes every now and then, so I wanted to see the contents of the folder to try to auto-detect and find the Nix shell.
So the actual question is: how can I run an xterm session with a Nix shell?
Longer answer: reading all the files in that directory consumes way too many resources. it’s better to interact with the nix packages using nix’ tools to efficiently inspect the installed packages.
(a similar problem can be exhibited locally by creating a directory with, literally, millions of files. some commandline tools will freeze and/or crash, which makes things like running rm -rf * impossible: you’ll need to craft a special program that does things more cleverly)
The nix magic is added in with the argument -rcfile /nix/store/fayv2rwr7z7lrw65s7ilwhcvn8jih9iz-replit-bashrc/bashrc, not with a specific shell.
Notice how that bashrc itself includes hardcoded paths, so there mustn’t be a problem with the paths for nix packages changing.
Ok so I was right, the file paths change. And so does the RC file, it updates automatically. So is there a way to always find the correct Nix shell RC files?