From 3f7f1a8cdbdf96e9b0655fd18f980b8b3c4fa0a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=93=9D=E6=9E=AB?= Date: Mon, 12 Jan 2015 13:31:20 +0800 Subject: [PATCH] Update jumpserver.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改PS1显示 --- jumpserver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jumpserver.py b/jumpserver.py index eba64f317..0738efcc9 100755 --- a/jumpserver.py +++ b/jumpserver.py @@ -125,7 +125,7 @@ def connect(host, port, user, password): logfile = open(logfile_name, 'a') # 记录日志文件 logfile.write('\nDateTime:%s' % logtime_start) foo.logfile = logfile - foo.sendline('') + foo.sendline("export PS1='[\u@%s \W]\$ ';clear" % host) signal.signal(signal.SIGWINCH, sigwinch_passthrough) size = getwinsize() foo.setwinsize(size[0], size[1]) @@ -307,4 +307,4 @@ if __name__ == '__main__': #except (BaseException, Exception): except IndexError: print "Exit." - sys.exit() \ No newline at end of file + sys.exit()