模板

from pwn import *
 
context.log_level = "debug"
context.terminal = ["wezterm.exe", "start"]
 
def sla(d, l):
    p.sendlineafter(d, l)
 
p = process("./b00ks")
gdb.attach(p)
 
p.interactive()

context.terminal for different terminals in pwntools.

# Zellij
context.terminal = ["zellij", "action", "new-pane", "-d", "right", "-c", "--", "bash", "-c"]
 
# Alacritty
context.terminal = ["alacritty", "-e", "bash", "-c"]
 
# GNOME Terminal
context.terminal = ["gnome-terminal", "--", "bash", "-c"]
 
# GNOME Console
context.terminal = ["kgx", "-e", "bash", "-c"]
 
# Xfce4 Terminal
context.terminal = ["xfce4-terminal", "-e"]