From: Alan Pinstein <apinstein@mac.com>
To: zsh-users@zsh.org
Subject: Re: Commands run from functions don't exit cleanly on terminal close (SIGHUP)?
Date: Mon, 05 Nov 2012 14:05:35 -0500 [thread overview]
Message-ID: <18244819-CAD8-4AA7-B46A-62C18CEC5BA3@mac.com> (raw)
In-Reply-To: <121102001808.ZM13144@torch.brasslantern.com>
> But now I think you mean
> zsh -> function -> function runs ssh -> ssh runs command -> HUP zsh
Yes.
I am on a Mac, using iTerm. I start a new window in iTerm. It loads my zshrc which includes a function definition that wraps ssh.
If I run "/usr/bin/ssh somewhere" (skipping the function) and then CLOSE the terminal window, the ssh call exits as expected and everything is great.
If I run "ssh somewhere" (which ssh's from inside a function) and then CLOSE the terminal window, the ssh command does not exit, it gets orphaned (ppid=1) and never exits. This causes issues b/c I think the command loses its TTY and it ends up hosing my screen session on the other end of the ssh session. If I kill the orphaned process, screen starts working immediately again.
I was able to reproduce the orphaning behavior with a PHP command so I know that it isn't some weird SSH bug.
Does that help?
Alan
prev parent reply other threads:[~2012-11-05 20:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2B813FB0-0877-42BA-974C-1A142EF09BCE@mac.com>
[not found] ` <909858C7-4B5A-4679-90B3-6BF5398BA9FC@mac.com>
[not found] ` <20121025112222.3dfbb213@pws-pc.ntlworld.com>
[not found] ` <D1AA5CA1-BB91-45D4-90D7-1596FF81F6AE@me.com>
[not found] ` <C6890E9F-F729-40FA-9305-055E9F165391@mac.com>
[not found] ` <121025075455.ZM3417@torch.brasslantern.com>
[not found] ` <E8AA19A7-2E79-48A4-BB2F-6F3CCF769EBC@mac.com>
2012-10-27 18:07 ` Bart Schaefer
2012-10-28 1:33 ` Alan Pinstein
2012-10-28 17:07 ` Bart Schaefer
2012-11-01 18:26 ` Alan Pinstein
2012-11-02 7:18 ` Bart Schaefer
2012-11-05 19:05 ` Alan Pinstein [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=18244819-CAD8-4AA7-B46A-62C18CEC5BA3@mac.com \
--to=apinstein@mac.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).