Search code examples
redisredis-cli

change redis command prompt text


I have a free-tier Redis Enterprise instance on AWS. I am running the latest stable version of redis on my Mac. I can connect to my Redis Enterprise instance using redis-cli with the -h parameter, and I get an interactive session which allows me to create and retrieve keys. However, the command prompt shows the full host url, which takes up most of the width of default terminal window. Is there a way to change the command prompt text (like Export PS1="" in bash) in redis-cli? Is there a redis-cli command, or a config file I can change?

Thanks,

Eric


Solution

  • No. Regrettably there is no way to customize the prompt displayed by redis-cli.

    However, instead of using the long hostname, you can replace it with -h ip-address that is usually shorter.

    Also, as a workaround, you could define the endpoint's hostname in your (where redis-cli is running) /etc/hosts as something shorter, e.g.:

    very.long.host.name.that.you.are.using    shorty
    

    and then call the cli with it:

    redis-cli -h shorty