From 82ae86ce3d649835e451510b4b69c2e90680c49e Mon Sep 17 00:00:00 2001 From: hugsy Date: Wed, 30 Oct 2024 08:59:21 -0700 Subject: [PATCH] allow clear screen command to be customized --- gef.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gef.py b/gef.py index c31ee9009..d8b4adcad 100644 --- a/gef.py +++ b/gef.py @@ -3900,7 +3900,8 @@ def clear_screen(tty: str = "") -> None: """Clear the screen.""" global gef if not tty: - gdb.execute("shell clear -x") + cmd: str = gef.config["gef.clear_screen_command"] + gdb.execute(f"shell {cmd}") return # Since the tty can be closed at any time, a PermissionError exception can @@ -9944,6 +9945,7 @@ def __init__(self) -> None: gef.config["gef.libc_version"] = GefSetting("", str, "Specify libc version when auto-detection fails") gef.config["gef.main_arena_offset"] = GefSetting("", str, "Offset from libc base address to main_arena symbol (int or hex). Set to empty string to disable.") gef.config["gef.propagate_debug_exception"] = GefSetting(False, bool, "If true, when debug mode is enabled, Python exceptions will be propagated all the way.") + gef.config["gef.clear_screen_command"] = GefSetting("clear -x", str, "Command to use to clear the screen.") self.commands : Dict[str, GenericCommand] = collections.OrderedDict() self.functions : Dict[str, GenericFunction] = collections.OrderedDict()