-1

A friend recently destroyed a server because he mistyped an IP address, and we thought: how could we make IP addresses clearer to the eye in our day to day Terminal use.

We mostly work from MacOS and use iTerm and connect to remote servers.

How it started

friend: I accidentally today destroyed a server because I mistyped an IP address. Oops.

me: sorry for your loss...

friend: Is there a iTerm2 setting to alwasy highlight/color IP addresses when they are displayed?

me: I believe it can be done

leonardo
  • 1,686
  • 15
  • 15

1 Answers1

2

in iTerm navigate to Preferences > Profiles > Advanced > Triggers > Edit and add this regex [0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3}) then select the Action: Highlight Text or Highlight Line.

Make sure the enable flag is present and choose Text Background colors as preferred.

Result: enter image description here

leonardo
  • 1,686
  • 15
  • 15