]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Unix Pageant: -T option, tying lifetime to controlling tty.
authorSimon Tatham <anakin@pobox.com>
Fri, 8 May 2015 18:50:48 +0000 (19:50 +0100)
committerSimon Tatham <anakin@pobox.com>
Mon, 11 May 2015 12:12:47 +0000 (13:12 +0100)
commitc59c6a8db99857b8e3aee8d620b3b4bfbe3f8fcc
tree97112ef37e316584e3aeb75f096cb40de10f3893
parentcc420507a98ed6aad8ef9260cfa70f32a45849b7
Unix Pageant: -T option, tying lifetime to controlling tty.

This is intended to be a useful mode when you want to run an ssh agent
in a terminal session with no X11 available. You just execute a
command along the lines of eval $(pageant -T), and then Pageant will
run in the background for the rest of that terminal session - and when
the terminal session ends, so that Pageant loses its controlling tty,
it will take that as the signal to shut down. So, no need to manually
kill it, and unlike 'pageant --exec $SHELL', you can also do this half
way through a session if you don't realise until later that you need
an SSH agent, without losing any shell command history or other shell
context that you've accumulated so far in the session.

Unfortunately, I haven't been able to find any reliable way to
actually implement this -T mode, short of having Pageant wake up at
regular intervals and try to open /dev/tty to see if it's still there.
I had hoped that I could arrange to reliably get SIGHUP, or select on
/dev/tty for exceptional conditions, or some such, but nothing I've
tried along those lines seems to work.
unix/uxpgnt.c