• ClaytonNorthey92's avatar
    Add reverse history search in redis-cli (linenoise) (#12543) · 8a05f009
    ClaytonNorthey92 authored
    added reverse history search to redis-cli, use it with the following:
    
    * CTRL+R : enable search backward mode, and search next one when
    pressing CTRL+R again until reach index 0.
    ```
    127.0.0.1:6379> keys one
    127.0.0.1:6379> keys two
    (reverse-i-search):                   # press CTRL+R
    (reverse-i-search): keys two          # input `keys`
    (reverse-i-search): keys one          # press CTRL+R again
    (reverse-i-search): keys one          # press CTRL+R again, still `keys one` due to reaching index 0
    (i-search): keys two                  # press CTRL+S, enable search forward
    (i-search): keys two                  # press CTRL+S, still `keys one` due to reaching index 1
    ```
    
    * CTRL+S : enable search forward mode, and search next one when pressing
    CTRL+S again until reach index 0.
    ```
    127.0.0.1:6379> keys one
    127.0.0.1:6379> keys two
    (i-search):                       # press CTRL+S
    (i-search): keys one              # input `keys`
    (i-...
    8a05f009
redis-cli.c 375 KB