pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

Highlighting certain hostnames in prompt

Open achanda opened this issue 3 years ago • 0 comments

Description

It will be useful to be able to highlight hostnames based on some criteria to be able to discern production hosts from regular hosts. In our deployment, all production hostnames start with prod. I propose that we add a new config option in pgclirc that looks like this:

[host_colour_config]
<host name regex> = <hex code for colour>

This will take affect only if prompt contains \h or \H. And if the hostname matches the given regex, it will be printed in the given colour.

If we agree this is useful, I am happy to implement this.

Your environment

  • [x] Please provide your OS and version information. MacOS 11.2.1
  • [x] Please provide your CLI version. Version: 3.1.0
  • [x] What is the output of pip freeze command.
boto3==1.17.9
botocore==1.20.9
cffi==1.14.5
credstash==1.17.1
cryptography==3.4.6
jmespath==0.10.0
mercurial==5.7
protobuf==3.14.0
pycparser==2.20
python-dateutil==2.8.1
s3transfer==0.3.4
six==1.15.0
urllib3==1.26.3

achanda avatar Feb 25 '21 21:02 achanda