jean-zay-users / jean-zay-doc

Collaborative documentation for and from Jean Zay users. Official Jean Zay documentation: http://www.idris.fr/eng/jean-zay/
https://jean-zay-doc.readthedocs.io/en/latest/
MIT License
106 stars 34 forks source link

Document how to use zsh #18

Open lesteve opened 4 years ago

lesteve commented 4 years ago
mypey commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

lesteve commented 4 years ago

Excellent thanks for letting us know!

RemiLacroix-IDRIS commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

flbbb commented 1 year ago

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
  2. Edit the .zshrc to enable the module command, in a new line add: source "$MODULESHOME/init/zsh"

  3. (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.