The clear command in screen only clears the visible screen, not screen's own scrollback buffer. This is expected behavior.
Solutions:
-
Use screen's built-in clear (recommended):
Press <kbd>Ctrl</kbd> + <kbd>A</kbd>, then <kbd>C</kbd> (capital C).
This clears both the screen and the scrollback buffer in screen.
-
Alias clear to send a full reset (add to ~/.bashrc or ~/.zshrc):
alias clear='printf "\033c"'
This sends a Full Reset (RIS) sequence, which clears scrollback in most terminals, including GNOME Terminal.
-
Use reset instead:
reset performs a full terminal reset, which typically clears scrollback.
After editing your shell config, reload it with:
source ~/.bashrc # or source ~/.zshrc