diff --git a/pwndbg/ui.py b/pwndbg/ui.py index 8fff77e9..f6cb39bb 100644 --- a/pwndbg/ui.py +++ b/pwndbg/ui.py @@ -93,7 +93,12 @@ def get_cmd_window_size(): Output of "info win" in non-TUI mode: (gdb) info win The TUI is not active.""" - info_out = gdb.execute("info win", to_string=True).split() + try: + info_out = gdb.execute("info win", to_string=True).split() + except gdb.error: + # Return None if the command is not compiled into GDB + # (gdb.error: Undefined info command: "win". Try "help info") + return None, None if "cmd" not in info_out: # if TUI is not enabled, info win will output "The TUI is not active." return None, None