How can I partially clear my terminal scrollback?

37,309

Not sure about partially, but you can fully clear your scrollback with Cmd+K. Control+L will only clear the screen, not the scrollback content/history/buffer.

If you want the partial scrollback badly enough, this would probably be the place to implement it.

Share:
37,309

Related videos on Youtube

Javid Jamae
Author by

Javid Jamae

Updated on September 18, 2022

Comments

  • Javid Jamae
    Javid Jamae almost 2 years

    I want to partially clear my terminal scrollback history, but only from where I have selected with my mouse in the scrollback and up. Is this possible? I'm on a Mac, and I use iTerm2 and Terminal.

  • Javid Jamae
    Javid Jamae over 10 years
    No, I think you misunderstood. The .bash_history file is for the command history, not the terminal scrollback history.
  • Javid Jamae
    Javid Jamae over 10 years
    Thanks, but man, that is some nasty code! I don't think I'd ever want anything so badly that I would have to get in to that codebase. :-)
  • bertieb
    bertieb about 6 years
    Welcome to Super User! Please reread the question- OP is asking about scrollback, not history.
  • Seamus
    Seamus about 2 years
    If this is still true - and it seems it is - that's very disappointing. The scrollback buffer looks like a trash dump, picking up bits from the pager & randomly over-writing stuff that might actually be useful.