diff --git a/gef.py b/gef.py index 8e9e4d2f3..fd58d6054 100644 --- a/gef.py +++ b/gef.py @@ -7379,6 +7379,9 @@ def do_invoke(self, argv: List[str]) -> None: if redirect and os.access(redirect, os.W_OK): enable_redirect_output(to_file=redirect) + if self["clear_screen"] and len(argv) == 0: + clear_screen(redirect) + for section in current_layout: if section[0] == "-": continue @@ -7400,9 +7403,6 @@ def do_invoke(self, argv: List[str]) -> None: self.context_title("") - if self["clear_screen"] and len(argv) == 0: - clear_screen(redirect) - if redirect and os.access(redirect, os.W_OK): disable_redirect_output() return