-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement a prompt_hostname function #3482
implement a prompt_hostname function #3482
Conversation
Standardize how the host name is included in the prompts that do so. Fixes #3480
Did you forget to commit the function? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fish: Unknown command 'fish_prompt_hostname'
Should this maybe be |
Oops, yes, stupid |
Is splitting on '.' from (I genuinely have no idea.) |
Agreed. Changed. |
It's supposed to be since the definition of |
In no case can the FQDN be something like "www.mysite.com" and |
If by simple host name you mean what is returned as the |
First of all, that's what we currently do, so there's no regression here. Secondly, this allows us to fix it in one place if we ever figure out a better solution. Thirdly: Probably not. This is probably one of those things where there's a super-rare super-complicated edge case that some people get really passionate about (maybe some way to make it recursive, or dependent on locale?). We'll get an issue and then we can work it out. Or they can just override the function. |
We used to use # Just calculate these once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname -s)
end |
Yeah, but in the other prompts we didn't. This was inconsistent. |
It looks like most of the sample prompts are not using this. |
Er, I'm totally mistaken. I was on Integration_2.4.0 and thought I was on master. And I mistakenly pushed two commits I shouldn't have. Reverting. |
Quick sanity check please that I didn't introduce a typo.
Standardize how the host name is included in the prompts that do so.
Fixes #3480