diff --git a/CHANGELOG.md b/CHANGELOG.md index f809a8d24..d461c8938 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,7 +73,9 @@ The table below shows which release corresponds to each branch, and what date th | [2.2.0](#220) | | Jan 5, 2015 ## 5.0.0 (`dev`) +- [#2522][2522] Support starting a kitty debugging window with the 'kitten' command +[2522]: https://github.com/Gallopsled/pwntools/pull/2522 ## 4.15.0 (`beta`) - [#2508][2508] Ignore a warning when compiling with asm on nix diff --git a/pwnlib/util/misc.py b/pwnlib/util/misc.py index e55465d33..a71fdce2c 100644 --- a/pwnlib/util/misc.py +++ b/pwnlib/util/misc.py @@ -450,13 +450,11 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr log.debug("Launching a new terminal: %r" % argv) stdin = stdout = stderr = open(os.devnull, 'r+b') - if terminal == 'tmux' or terminal == 'kitty': + if terminal == 'tmux' or terminal in ('kitty', 'kitten'): stdout = subprocess.PIPE p = subprocess.Popen(argv, stdin=stdin, stdout=stdout, stderr=stderr, preexec_fn=preexec_fn) - kittyid = None - if terminal == 'tmux': out, _ = p.communicate() try: @@ -469,7 +467,7 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr with subprocess.Popen((qdbus, konsole_dbus_service, '/Sessions/{}'.format(last_konsole_session), 'org.kde.konsole.Session.processId'), stdout=subprocess.PIPE) as proc: pid = int(proc.communicate()[0].decode()) - elif terminal == 'kitty': + elif terminal in ('kitty', 'kitten'): pid = p.pid out, _ = p.communicate() @@ -503,7 +501,7 @@ def kill(): try: if terminal == 'qdbus': os.kill(pid, signal.SIGHUP) - elif terminal == 'kitty': + elif terminal in ('kitty', 'kitten'): subprocess.Popen(["kitten", "@", "close-window", "--match", "id:{}".format(kittyid)], stderr=stderr) else: os.kill(pid, signal.SIGTERM)