On Linux Mint 22.3 Cinnamon GNOME Terminal `clear` in `screen` behaves like <kbd>ctrl</kbd> + <kbd>c</kbd>, that is I can scroll up, how to solve this issue?
May 23, 7:42pm

The clear command in screen only clears the visible screen, not screen's own scrollback buffer. This is expected behavior.

Solutions:

  1. 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.

  2. Alias clear to send a full reset (add to ~/.bashrc or ~/.zshrc):

    bash
    alias clear='printf "\033c"'

    This sends a Full Reset (RIS) sequence, which clears scrollback in most terminals, including GNOME Terminal.

  3. Use reset instead:

    bash
    alias clear='reset'

    reset performs a full terminal reset, which typically clears scrollback.

After editing your shell config, reload it with:

bash
source ~/.bashrc  # or source ~/.zshrc
May 23, 7:42pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Le Chat can make mistakes. Check answers. Learn more