Skip to content

Commit e841b50

Browse files
authored
Add gnome-terminal, Alacritty, Ttilix for run_in_new_terminal (#2578)
1 parent 76078a3 commit e841b50

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ The table below shows which release corresponds to each branch, and what date th
9292
- [#2538][2538] Add `ssh -L` / `ssh.connect_remote()` workaround when `AllowTcpForwarding` is disabled
9393
- [#2574][2574] Allow creating an ELF from in-memory bytes
9494
- [#2575][2575] Detect when Terminator is being used as terminal
95+
- [#2578][2578] Add gnome-terminal, Alacritty, Ttilix for run_in_new_terminal
9596

9697
[2419]: https://github.com/Gallopsled/pwntools/pull/2419
9798
[2551]: https://github.com/Gallopsled/pwntools/pull/2551
@@ -110,6 +111,7 @@ The table below shows which release corresponds to each branch, and what date th
110111
[2538]: https://github.com/Gallopsled/pwntools/pull/2538
111112
[2574]: https://github.com/Gallopsled/pwntools/pull/2574
112113
[2575]: https://github.com/Gallopsled/pwntools/pull/2575
114+
[2578]: https://github.com/Gallopsled/pwntools/pull/2578
113115

114116
## 4.15.0 (`beta`)
115117

pwnlib/util/misc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,15 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr
336336
else:
337337
terminal = 'terminator'
338338
args = ['-e']
339+
elif "GNOME_TERMINAL_SCREEN" in os.environ and "GNOME_TERMINAL_SERVICE" in os.environ and which("gnome-terminal"):
340+
terminal = 'gnome-terminal'
341+
args = ['-e']
342+
elif "ALACRITTY_SOCKET" in os.environ and "ALACRITTY_WINDOW_ID" in os.environ and which("alacritty"):
343+
terminal = 'alacritty'
344+
args = ['-e']
345+
elif "TILIX_ID" in os.environ and which("tilix"):
346+
terminal = "tilix"
347+
args = ['-a', 'session-add-right', '-e']
339348
elif 'KONSOLE_VERSION' in os.environ and which('qdbus'):
340349
qdbus = which('qdbus')
341350
window_id = os.environ['WINDOWID']

0 commit comments

Comments
 (0)