4

Is there a way to clear Redis shell (Redis-cli) from the output of the previous commands?

Basically I need completely the same action like I have answered in this question, but instead MongoDB I need it for Redis.

P.S. I tried clc, cls, clear, CTR + L but as you understood with no results.

Community
  • 1
  • 1
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753

1 Answers1

5

On terminals supported by Linenoise (used in redis-cli), both clear and CTRL-L work fine. It does with my ssh connection. Linenoise implements clear screen in the following way:

void linenoiseClearScreen(void) {
    if (write(STDIN_FILENO,"\x1b[H\x1b[2J",7) <= 0) {
        /* nothing to do, just to avoid warning. */
    }
}

So I guess this sequence does not work on your terminal ... or perhaps, you are using a very old version of redis-cli?

Didier Spezia
  • 70,911
  • 12
  • 189
  • 154