geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
931 stars 94 forks source link

Ship colorize symbol enabled by default #187

Closed desyncr closed 6 years ago

desyncr commented 6 years ago

I was moving between SSH session and local paths (both with geometry theme) and I found quite hard to recognize which one was SSH and which one wasn't. I think it'll be a good idea to ship with colorize symbol enabled by default.

Opinions?

jedahan commented 6 years ago

Sometimes colorize symbol picks the same color (if hostname hashes to the same thing). Before we have people rely on it, I'd like it to be more robust.

Maybe having the plugin keep track of all hostnames, and if its a new one, picking a new color that way.

Not sure how to sync it though. Perhaps making a separate ssh plugin?

desyncr commented 6 years ago

@jedahan Well, I have also thinking about a hostname plugin (See here).

Regarding color I believe it was mentioned it before. Not sure how to solve it honestly.

jedahan commented 6 years ago

If we are ok with getting wan ip address, we can use that to colorize. Then we can check the client ip address in SSH_CONNECTION, and if it hashes to the same color, we nonce up one.

Real hacky, but might work. Tricky part is when not ssh'd, and that local ip address changes a bunch so you can't make a color map in your head that stays consistent.

jedahan commented 6 years ago

Simplified version: local is colorhash remote is yellow (is SSH_CLIENT defined?) root is red (local and remote)

This is good enough to ship

jedahan commented 6 years ago

we might want 2 plugins, or just a flag for one plugin

it should also check if colors are enabled

jedahan commented 6 years ago

@desyncr can we ship enabled by default now that we have hostname plugin?

jedahan commented 6 years ago

I think we can skip this