From 7e5e036a09466057a673c6530f70772882c149c2 Mon Sep 17 00:00:00 2001 From: n1nj4sec Date: Sun, 1 Nov 2015 12:21:41 +0100 Subject: [PATCH] interactive shell bugfix : pupy server stdin was closed at exit because of the python gc --- pupy/modules/interactive_shell.py | 3 +-- pupy/pupy.conf | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pupy/modules/interactive_shell.py b/pupy/modules/interactive_shell.py index f08c3fbf..efc88f9e 100644 --- a/pupy/modules/interactive_shell.py +++ b/pupy/modules/interactive_shell.py @@ -49,10 +49,9 @@ class InteractiveShell(PupyModule): ps.start_read_loop(print_callback, is_closed.set) try: fd=sys.stdin.fileno() - f=os.fdopen(fd,'r') old_settings = termios.tcgetattr(fd) try: - tty.setraw(fd) + tty.setraw(sys.stdin.fileno()) input_buf=b"" while True: r, w, x = select.select([sys.stdin], [], [], 0) diff --git a/pupy/pupy.conf b/pupy/pupy.conf index e9c335b8..19305d0b 100644 --- a/pupy/pupy.conf +++ b/pupy/pupy.conf @@ -14,5 +14,7 @@ pyexec = pyexec exec = shell_exec ps = ps migrate = migrate +shell=interactive_shell kill = process_kill +killme = pyexec -c 'import os;os.kill(os.getpid(),9)' #tasklist = shell_exec 'tasklist /v'