Skip to content

Commit

Permalink
Respect TERM_PROGRAM for run_in_new_terminal. Fixes #964. (#967)
Browse files Browse the repository at this point in the history
* Respect TERM_PROGRAM for run_in_terminal.  Fixes #964.

* Set args for TERM_PROGRAM.
  • Loading branch information
Matir authored and zachriggle committed May 1, 2017
1 parent ac38687 commit 7fe6dd0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pwnlib/util/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ 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']
args = []
elif 'DISPLAY' in os.environ:
terminal = 'x-terminal-emulator'
args = ['-e']
Expand Down

0 comments on commit 7fe6dd0

Please sign in to comment.