sindresorhus / pure

Pretty, minimal and fast ZSH prompt
MIT License
13.12k stars 971 forks source link

Add configuration option for mapping username/hostname per-host #641

Closed ELLIOTTCABLE closed 10 months ago

ELLIOTTCABLE commented 2 years ago

This PR implements a configuration-option that allows users to provide a mapping of replacement user- and host-names for systems they do not control, but often SSH into.

As an example, we use nspawn at my organization, and I do not have control over my username — this PR allows me to replace the infinitely-annoying elliott.cable@spawnbox-febox3-elliottcable with ec@nspawn3:

typeset -gA PURE_HOST_MAP
PURE_HOST_MAP[spawnbox-febox3-elliottcable]="elliott.cable:ec@nspawn3"

As for the rest, well, this is best understood from the documentation I've added to the README.

(Implementing this in a sufficiently-general way ended up being mildly messy; enough so that I'll understand if you don't wish to upstream this improvement. If not, I intend to main this feature in my fork; could you add ELLIOTTCABLE/pure to the list of maintained forks?)

This implements #488, and solves #614 and #136.

sindresorhus commented 1 year ago

Thanks for the pull request. However, I don't think this is something we want to maintain. What we could consider is exposing some kind of minimal hook to let you implement this yourself.

ELLIOTTCABLE commented 10 months ago

However, I don't think this is something we want to maintain. good eyes, and a reassuring response; I like slim.

any ideas of the best approach? i'm limited on time, but can take a brief glance if it's approachable to an outsider.