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

Re: timeout problem in ssh sessions

On 2008-02-13 22:21:22 +0800, ubergoonz wrote:
> I used to have this problem a few years ago when my workplace is using an
> older versio of openssh.
> this is more like a behavior with openssh then zsh
> http://www.openssh.com/faq.html#3.10
> http://www.snailbook.com/faq/background-jobs.auto.html

Note that hangs also occur when non-standard file descriptors are
still attached to the terminal. This happens when one does "exec zsh"
from some old tcsh versions (but that can still be found), because
tcsh forgot to close some descriptors in its exec builtin. So, I use
the attached wrapper in my .cshrc:

if ($?ZSH) then
  if (-x $ZSH) then
    setenv SHELL $ZSH
    if ($?loginsh) set ZSH = "$ZSH -l"
    if ($?prompt) echo "executing $ZSH"
    exec shexec $ZSH

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 / Arenaire project (LIP, ENS-Lyon)
#!/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 $_ }
} 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.

exec @ARGV;

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

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