From dff64e2366fab94b9cf25d8ab7ae866433ee8b13 Mon Sep 17 00:00:00 2001 From: Heap Crash <66139157+heapcrash@users.noreply.github.com> Date: Mon, 31 May 2021 15:20:35 -0500 Subject: [PATCH 1/3] For tmux, always specify -F and -P (#1902) * For tmux, always specify -F and -P Fixes #1898 * [4.5.1] Update CHANGELOG --- CHANGELOG.md | 15 +++++++++++---- pwnlib/util/misc.py | 8 +++++++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdcb2221f..f2e696cff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,10 @@ The table below shows which release corresponds to each branch, and what date th | Version | Branch | Release Date | | ---------------- | -------- | ---------------------- | -| [4.7.0](#470) | `dev` | May 29, 2020 (planned) -| [4.6.0](#460) | `beta` | May 29, 2020 (planned) -| [4.5.0](#450) | `stable` | Apr 30, 2020 +| [4.7.0](#470) | `dev` | +| [4.6.0](#460) | `beta` | +| [4.5.1](#451) | `stable` | May 30, 2020 +| [4.5.0](#450) | | Apr 30, 2020 | [4.4.0](#440) | | Mar 29, 2020 | [4.3.1](#431) | | Nov 29, 2020 | [4.3.0](#430) | | Oct 20, 2020 @@ -89,7 +90,13 @@ The table below shows which release corresponds to each branch, and what date th [1776]: https://github.com/Gallopsled/pwntools/pull/1776 [1846]: https://github.com/Gallopsled/pwntools/pull/1846 -## 4.5.0 (`stable`) +## 4.5.1 (`stable`) + +- [#1902][1902] Always specify -F and -P for tmux in run_in_new_termianl + +[1902]: https://github.com/Gallopsled/pwntools/pull/1902 + +## 4.5.0 - [#1261][1261] Misc `run_in_new_terminal` improvements (notably gdb terminated by default) - [#1695][1695] Allow using GDB Python API diff --git a/pwnlib/util/misc.py b/pwnlib/util/misc.py index c0a0b3317..c640dfeeb 100644 --- a/pwnlib/util/misc.py +++ b/pwnlib/util/misc.py @@ -229,7 +229,7 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr args = [] elif 'TMUX' in os.environ and which('tmux'): terminal = 'tmux' - args = ['splitw', '-F' '#{pane_pid}', '-P'] + args = ['splitw'] elif 'STY' in os.environ and which('screen'): terminal = 'screen' args = ['-t','pwntools-gdb','bash','-c'] @@ -256,6 +256,12 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr if isinstance(args, tuple): args = list(args) + # When not specifying context.terminal explicitly, we used to set these flags above. + # However, if specifying terminal=['tmux', 'splitw', '-h'], we would be lacking these flags. + # Instead, set them here and hope for the best. + if terminal == 'tmux': + args += ['-F' '#{pane_pid}', '-P'] + argv = [which(terminal)] + args if isinstance(command, six.string_types): From 2d460e573889d5d614160a43041addf880c2256e Mon Sep 17 00:00:00 2001 From: Heap Crash <66139157+heapcrash@users.noreply.github.com> Date: Mon, 31 May 2021 15:29:49 -0500 Subject: [PATCH 2/3] [4.5.1] Update version.py (#1908) --- pwnlib/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwnlib/version.py b/pwnlib/version.py index 330025d80..ef6eca306 100644 --- a/pwnlib/version.py +++ b/pwnlib/version.py @@ -1 +1 @@ -__version__ = '4.5.0' +__version__ = '4.5.1' From 5b0bec0c09c24f769a02b676500795db36dd40e0 Mon Sep 17 00:00:00 2001 From: heapcrash Date: Mon, 31 May 2021 15:44:49 -0500 Subject: [PATCH 3/3] [4.5.1] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 039ff53bf..5c9746db2 100755 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ name = 'pwntools', python_requires = '>=2.7', packages = find_packages(), - version = '4.5.0', + version = '4.5.1', data_files = [('pwntools-doc', glob.glob('*.md') + glob.glob('*.txt')), ],