Closed desyncr closed 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?
@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.
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.
Simplified version:
local is colorhash
remote is yellow (is SSH_CLIENT
defined?)
root is red (local and remote)
This is good enough to ship
we might want 2 plugins, or just a flag for one plugin
it should also check if colors are enabled
@desyncr can we ship enabled by default now that we have hostname plugin?
I think we can skip this
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?