Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: I get tcsh at login; want zsh



On 2006-07-17 02:09:51 +0200, Mikael Magnusson wrote:
> On 7/17/06, Russell Hoover <rj@xxxxxxxxx> wrote:
[...]
> >What do I need to do to be able to log directly into and directly out
> >of zsh?
> 
> Check what startup files are used by tcsh and put 'exec zsh' in it.

Some care must be taken. At the end of your .cshrc:

if ($?prompt && ! $?TCSH) then
  if ("$prompt" != "" && -X zsh) then
    setenv SHELL `which \zsh`
    if ($?loginsh) set SHELL = "$SHELL -l"
    exec shexec $SHELL
  endif
endif

where shexec is the attached Perl script. The tcsh exec bug has been
fixed in recent versions of tcsh; so, you may not necessarily need
shexec.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
#!/usr/bin/env perl

# Workaround for the tcsh exec bug. Example:
#   tcsh> exec shexec zsh

use strict;

eval {
  require POSIX;
  foreach (3..63)
    { POSIX::close $_ if -t $_ }
  1;
} or warn <<"EOF";
Perl POSIX module not found! The non-standard file descriptors attached
to a tty (as those let open by this buggy tcsh) could not be closed.
EOF

exec @ARGV;

# $Id: shexec 11281 2006-02-27 13:24:27Z lefevre $


Messages sorted by: Reverse Date, Date, Thread, Author