Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to use zsh #18

Open
lesteve opened this issue Mar 10, 2020 · 8 comments
Open

Document how to use zsh #18

lesteve opened this issue Mar 10, 2020 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@lesteve
Copy link
Member

lesteve commented Mar 10, 2020

@mypey
Copy link
Contributor

mypey commented Mar 10, 2020

Hi @lesteve,
just one comment here: the official shell on Jean Zay is bash. In particular, all system scripts are bash scripts. Additional shells are installed but we do not provide support for them yet. zsh might work very well (and I hope it will) but I just want to warn you that if there are some troubles when using it, this will be considered as a low priority issue.

@lesteve
Copy link
Member Author

lesteve commented Mar 10, 2020

Thanks a lot for the precision! I think I have seen it somewhere in your official doc that bash was the only supported shell indeed. I will make sure to mention that zsh is not supported officially!

In practice I have not noticed any issue so far so I thought I would mention that if people are interested.

Just to explain, I am used to have a zsh prompt and there are a few zsh features or rather prezto features (a zsh framework similar to oh-my-zsh) that I can not live without (nice prompt, autosuggestions, Control-P matching anywhere in my history, Alt-P matching history with the whole beginning of my command, etc ...).

Basically this is a way to feel more at home and productive on Jean Zay!

@rstrudel
Copy link
Contributor

rstrudel commented Mar 25, 2020

It does work for fish too. I have a similar setup:

  • install fish from conda-forge
  • to get the module command
    source /gpfslocalsup/spack_soft/environment-modules/current/init/fish
  • add exec $PATH_TO_CONDA_ENVS/bin/fish -l to your .bashrc

@lesteve
Copy link
Member Author

lesteve commented Mar 25, 2020

Excellent thanks for letting us know!

@RemiLacroix-IDRIS
Copy link
Contributor

RemiLacroix-IDRIS commented Jun 24, 2020

source /.../environment-modules/4.3.1/gcc-4.8.5-ism7cdy4xverxywj27jvjstqwk5oxe2v/init/zsh so that the module command works. Probably needs something a bit more robust than this complicated name.

It would indeed to better to use /.../environment-modules/current/init/... instead.

@lesteve
Copy link
Member Author

lesteve commented Jun 25, 2020

Yep I looked at my .zshrc and that's what I have indeed (I edited my first post):

MODULE_INIT_ZSH=/gpfslocalsup/spack_soft/environment-modules/current/init/zsh
if [[ -s "$MODULE_INIT_ZSH" ]]; then
  source "$MODULE_INIT_ZSH"
fi

@RemiLacroix-IDRIS
Copy link
Contributor

In fact we even have an environment variable $MODULESHOME but I am not sure if it's inherited by zsh?

@lesteve lesteve added the help wanted Extra attention is needed label Apr 4, 2021
@flbbb
Copy link

flbbb commented Jul 10, 2023

In case someone doesn't want to use conda, zsh can be compiled from source without sudo (https://stackoverflow.com/a/15293565).

  1. Install zsh form source
wget -O zsh.tar.xz https://sourceforge.net/projects/zsh/files/latest/download
mkdir zsh && unxz zsh.tar.xz && tar -xvf zsh.tar -C zsh --strip-components 1
cd zsh
./configure --prefix=$HOME
make
make install
  1. Edit the .zshrc to enable the module command, in a new line add: source "$MODULESHOME/init/zsh"
  2. (zsh on login) Edit your .bashrc and add in a new line: exec zsh

PS: If something goes wrong after editing the .bashrc, i.e., zsh has not been properly installed or whatever, the shell will raise an error and close the ssh connection. The solution is to remove the problematic line (e.g. exec zsh), but since the ssh connection is closed upon login, it's annoying. Simple "hacky" solution is to ssh into jean-zay and hit Ctrl+c as soon as the authentification is done (when the welcome screen is printed). This will stop the execution of the .bashrc and gives you access the the shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants