Skip to content

Commit 60cff24

Browse files
authored
Detect when kitty is being used as terminal (#2551)
1 parent 8867247 commit 60cff24

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The table below shows which release corresponds to each branch, and what date th
7474

7575
## 5.0.0 (`dev`)
7676

77+
- [#2551][2551] Detect when kitty is being used as terminal
7778
- [#2519][2519] Drop Python 2.7 support / Require Python 3.10
7879
- [#2507][2507] Add `+LINUX` and `+WINDOWS` doctest options and start proper testing on Windows
7980
- [#2522][2522] Support starting a kitty debugging window with the 'kitten' command
@@ -86,6 +87,7 @@ The table below shows which release corresponds to each branch, and what date th
8687
- [#2506][2506] ROP: fix `ROP(ELF(exe)).leave` is `None` in some ELF
8788
- [#2504][2504] doc: add example case for `tuple` (host, port pair) in `gdb.attach`
8889

90+
[2551]: https://github.com/Gallopsled/pwntools/pull/2551
8991
[2519]: https://github.com/Gallopsled/pwntools/pull/2519
9092
[2507]: https://github.com/Gallopsled/pwntools/pull/2507
9193
[2522]: https://github.com/Gallopsled/pwntools/pull/2522

pwnlib/util/misc.py

+3
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr
326326
elif 'DISPLAY' in os.environ and which('x-terminal-emulator'):
327327
terminal = 'x-terminal-emulator'
328328
args = ['-e']
329+
elif 'KITTY_PID' in os.environ and which('kitty') and which('kitten'):
330+
terminal = 'kitten'
331+
args = ['@', 'launch']
329332
elif 'KONSOLE_VERSION' in os.environ and which('qdbus'):
330333
qdbus = which('qdbus')
331334
window_id = os.environ['WINDOWID']

0 commit comments

Comments
 (0)