From f485d6b57c8798d0a5fbe0af713bdcf626b61692 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sun, 30 Apr 2017 18:53:02 -0700 Subject: [PATCH 1/2] Respect TERM_PROGRAM for run_in_terminal. Fixes #964. --- pwnlib/util/misc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pwnlib/util/misc.py b/pwnlib/util/misc.py index 6c7fafc0f..cde28920a 100644 --- a/pwnlib/util/misc.py +++ b/pwnlib/util/misc.py @@ -210,6 +210,8 @@ def run_in_new_terminal(command, terminal = None, args = None): elif which('pwntools-terminal'): terminal = 'pwntools-terminal' args = [] + elif 'TERM_PROGRAM' in os.environ: + terminal = os.environ['TERM_PROGRAM'] elif 'DISPLAY' in os.environ: terminal = 'x-terminal-emulator' args = ['-e'] From 8bea5ad837cf043670f526d465f504ae353fbd1e Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Sun, 30 Apr 2017 21:26:29 -0700 Subject: [PATCH 2/2] Set args for TERM_PROGRAM. --- pwnlib/util/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pwnlib/util/misc.py b/pwnlib/util/misc.py index cde28920a..474ad8086 100644 --- a/pwnlib/util/misc.py +++ b/pwnlib/util/misc.py @@ -212,6 +212,7 @@ def run_in_new_terminal(command, terminal = None, args = None): args = [] elif 'TERM_PROGRAM' in os.environ: terminal = os.environ['TERM_PROGRAM'] + args = [] elif 'DISPLAY' in os.environ: terminal = 'x-terminal-emulator' args = ['-e']