Merge pull request #473 from joerango/master

Support for running arbitrary command when starting terminal
This commit is contained in:
lantz
2015-03-13 15:09:11 -07:00
+2 -2
View File
@@ -35,7 +35,7 @@ def tunnelX11( node, display=None):
"EXEC:'mnexec -a 1 socat STDIO %s'" % connection ]
return 'localhost:' + screen, node.popen( cmd )
def makeTerm( node, title='Node', term='xterm', display=None ):
def makeTerm( node, title='Node', term='xterm', display=None, cmd='bash'):
"""Create an X11 tunnel to the node and start up a terminal.
node: Node object
title: base title
@@ -54,7 +54,7 @@ def makeTerm( node, title='Node', term='xterm', display=None ):
display, tunnel = tunnelX11( node, display )
if display is None:
return []
term = node.popen( cmds[ term ] + [ display, '-e', 'env TERM=ansi bash'] )
term = node.popen( cmds[ term ] + [ display, '-e', 'env TERM=ansi %s' % cmd ] )
return [ tunnel, term ] if tunnel else [ term ]
def runX11( node, cmd ):