Open MilesCranmer opened 1 month ago
You are the first person to mention nushell. If you are interested in having Lmod be supported by nushell, please submit a pull request to support this shell.
Sure, how should I get started?
Here are my suggestions:
docs/source/030_installing.rst
on how your startup files work.I'm closing this issue. If you get a chance to work on this, you can re-open this issue.
I'm still interested; please re-open. Just haven't had a chance to work much on this yet.
I don't think it will be that difficult. Basically whenever bash has
export CMD="..."
the nushell version would be
$env.CMD = "..."
The tricky part would be things like PATH
as nushell treats that as an array rather than a :
-separated string. For that one would do
std path add "/path/to/bin"
And string interpolation for e.g., "${MY_DIR}/path"
would be
$"($env.MY_DIR)/path"
Lmod does not add to path and path-like variables. Instead it sets the variable to all values. I did not think about nushell would have a different syntax from Bash. You will have to create a lua file called nushell.lua which works like Bash.lua or Rc.lua. You will have to modify BaseShell.lua. All of these files are in the shells directory.
The way that Lmod works is that it generates text which is then evaluated by the shell. You should write a text file that contains some nushell commands and make sure that you can evaluate commands. In Bash/Zsh this looks like
eval "$(...)"
where the ... is some like cat nushell.txt
Just wondering if anybody has started a nushell integration for Lmod?
See https://github.com/nushell/nushell and https://www.nushell.sh/ for info.
Perhaps one way to do it is through the overlay system: https://www.nushell.sh/book/overlays.html. But maybe it is enough to just write some aliases so nushell is interfaced as if it were bash.