Using zsh

Hi all

i am forced to use tcsh at work but i want to use zsh, so i have added this to my .cshrc

if (! $?STARTTCSH) then
    if ("$tty" != "" && -x /bin/zsh) exec /bin/zsh
    exit
endif

but this now stopped me going back to tcsh if i need to, is there a way to do this, i would normally just typr tcsh in a shell and that would let me but with the above coding i cannot

tbanks

Why not just login and type zsh?

Does not seem like much trouble to me.

because i use a shell the whole time so i want it always run zsh ( and i open and close a lot of shells) but if i need to i can revert back to tcsh

Export an environment variable so you can check if you want to skip that programming. Have your code check for it.

export NOZSH=1
exec /bin/tcsh

Hi.

exec tcsh would surely run the .cshrc again and invoke zsh?

If you removed the exec from your .cshrc file, then you can get back using to tcsh by pressing �D or typing exit from your zsh shell.

edit: Saw corona688's update, which is a work-around.

ah you see i want to be able to switch betwee the but zsh to be my default one

I can't imagine why anyone would <<force>> you to use a specific shell - especially that one!

They obviously don't "force" you too much if you can run zsh in the first place.

You can't change the default with chsh?

If nothing else, there's Neo's suggestion. Just type zsh when you want to use it... Put an alias Z in your .cshrc if that make it a little easier for you :slight_smile:

Yes, open a new term window (or whatever you have) and type your alias "z" and be done with it, LOL. Exit when you want to go back to the login shell, and type your "z" alias when you want to go back there, as scottn suggested.