From 0cbb4b2afc33d141915968ec6cf3d55f8d325f93 Mon Sep 17 00:00:00 2001 From: Florian Mounier Date: Fri, 28 Feb 2014 12:20:41 +0100 Subject: [PATCH] Fix shell name in argv[0] --- butterfly/__init__.py | 2 +- butterfly/routes.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/butterfly/__init__.py b/butterfly/__init__.py index 9b1b3b4..aeb0ee8 100644 --- a/butterfly/__init__.py +++ b/butterfly/__init__.py @@ -14,7 +14,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -__version__ = '1.2.0' +__version__ = '1.2.1' import os diff --git a/butterfly/routes.py b/butterfly/routes.py index 5067f67..12047d4 100644 --- a/butterfly/routes.py +++ b/butterfly/routes.py @@ -105,26 +105,23 @@ class TermWebSocket(Route, tornado.websocket.WebSocketHandler): except: pass + shell = tornado.options.options.shell or self.callee.shell env = os.environ env.update(self.socket.env) - env["TERM"] = "xterm-256color" env["COLORTERM"] = "butterfly" env["HOME"] = self.callee.dir - env["SHELL"] = self.callee.shell env["LOCATION"] = "http://%s:%d/" % ( tornado.options.options.host, tornado.options.options.port) env["PATH"] = '%s:%s' % (os.path.abspath(os.path.join( os.path.dirname(__file__), '..', 'bin')), env.get("PATH")) - args = ['butterfly'] + args = [shell] if self.socket.local: # All users are the same -> launch shell if self.caller == self.callee and server == self.callee: args.append('-i') - os.execvpe( - tornado.options.options.shell or self.callee.shell, - args, env) + os.execvpe(shell, args, env) # This process has been replaced return