trya2l
1
Hi,
I’ve installed direnv but I don’t know if I can change my zsh prompt with shellHook
Currently, I’ve this that doesn’t seem to work:
{pkgs ? import <nixpkgs> {}}:
with pkgs;
let
gems = bundlerEnv {
name = "blog";
gemdir = ./.;
};
in mkShell {
buildInputs = [ gems gems.wrappedRuby ];
shellHook = ''
PS1="%m" # or export PS1="%m"
bundler config set --local force_ruby_platform true
'';
}
I don’t think you need shellHook
to change the prompt. I think setting PS1 like this should work, but never tried it:
mkShell {
PS1 = "<whatever>";
}
trya2l
4
this seems to work for any random variables
mkShell {
test="test";
}
direnv: export ... +shell +shellHook ... +test ...
but not for PS1
mkShell {
PS1 = "%m";
}
direnv: export ... +shell +shellHook ... ...
trya2l
5
I’ll take a look, but does it work with direnv ?
What I would do at this point is search the direnv codebase for PS1
.
1 Like
trya2l
7
You may be right, I’ll try. Thanks
Yes, they have a direnv module: Configuration | Starship
1 Like