Fix: Undefined info command: "win" (#1775)

* Return no cmd window size when info win is not avaiable

* Update pwndbg/ui.py

---------

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
This commit is contained in:
Ido Frankenthal 2023-07-04 14:56:40 +03:00 committed by GitHub
parent 0db1eeadca
commit 52d729f574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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