hotssh r61 - trunk/bin



Author: walters
Date: Wed Dec  3 02:04:22 2008
New Revision: 61
URL: http://svn.gnome.org/viewvc/hotssh?rev=61&view=rev

Log:
Only do fork/setsid dance after we've determined not to run /usr/bin/ssh

Otherwise we incorrectly disassociate from the controlling tty which
causes all sorts of brokenness.

Modified:
   trunk/bin/hotssh

Modified: trunk/bin/hotssh
==============================================================================
--- trunk/bin/hotssh	(original)
+++ trunk/bin/hotssh	Wed Dec  3 02:04:22 2008
@@ -19,16 +19,6 @@
 
 import sys, os
 
-# We want to avoid running under the controlling terminal if we were passed
-# --bg, which by default comes from our sh/csh alias 
-if len(sys.argv) > 1 and sys.argv[1] == '--bg' and os.isatty(0):
-    pid = os.fork()
-    if pid == 0:
-       del sys.argv[1]
-       os.setsid()
-    else:
-       sys.exit(0)
-
 if __name__ == '__main__' and hasattr(sys.modules['__main__'], '__file__'):
     basedir = os.path.dirname(os.path.abspath(__file__))
     up_basedir = os.path.dirname(basedir)
@@ -65,6 +55,16 @@
 if exec_real_ssh:
 	os.execvp('ssh', ['ssh'] + sys.argv[1:])
 
+# We want to avoid running under the controlling terminal if we were passed
+# --bg, which by default comes from our sh/csh alias 
+if len(sys.argv) > 1 and sys.argv[1] == '--bg' and os.isatty(0):
+    pid = os.fork()
+    if pid == 0:
+       del sys.argv[1]
+       os.setsid()
+    else:
+       sys.exit(0)
+
 from hotssh.sshwindow import SshApp
 from hotssh.hotvte.vtewindow import VteMain
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]