Skip to content

Commit b9db8a1

Browse files
committed
fix: x-terminal does not work properly gdb.attach
1 parent 3b4b261 commit b9db8a1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ The table below shows which release corresponds to each branch, and what date th
7272
## 4.14.0 (`dev`)
7373

7474
- [#2356][2356] Add local libc database provider for libcdb
75+
- [#2362][2362] Fix x-terminal does not work properly gdb.attach
7576

7677
[2356]: https://github.com/Gallopsled/pwntools/pull/2356
78+
[2362]: https://github.com/Gallopsled/pwntools/issues/2362
7779

7880
## 4.13.0 (`beta`)
7981

pwnlib/util/misc.py

+5
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,11 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr
460460
with subprocess.Popen((qdbus, konsole_dbus_service, '/Sessions/{}'.format(last_konsole_session),
461461
'org.kde.konsole.Session.processId'), stdout=subprocess.PIPE) as proc:
462462
pid = int(proc.communicate()[0].decode())
463+
elif terminal == 'x-terminal-emulator':
464+
if "gnome-terminal" in os.readlink(os.readlink(which(terminal))):
465+
pid = p.pid + 1
466+
else:
467+
pid = p.pid
463468
else:
464469
pid = p.pid
465470

0 commit comments

Comments
 (0)