Skip to content
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

Feature: show full hostname #254

Closed
wants to merge 7 commits into from

Conversation

berserck
Copy link

Added possibility to show domain if host name is shown.

I've added the option LP_DOMAIN to show the domain if the host name is shown.
I also edited the test.sh file to test for new feature.

I'm using the command hostname -f instead of the \H (for bash) and %M(for zsh)
because I noticed that the \H is bash is not the same in all systems (zsh is coherent):

In macos (bash 3.2.48(1)-release) and freeBSD(bash 4.2.45(0)-release) :

# hostname -f
host.domain
# export PS1=" \\\h=\h \\\H=\H #"
 \h=host \H=host.domain #

In linux: SLC6 (bash: 4.1.2(1)-release), debian(bash:4.2.37(1)-release ) and ubunto(bash: 4.2.25(1)-release) ):

# hostname -f
host.domain
# export PS1=" \\\h=\h \\\H=\H #"
 \h=host \H=host #

berserck and others added 7 commits December 19, 2013 11:07
Merge changes from the develop branch:
- many fixes, in particular for MacOS X (battery)
- many speed improvments (Mercurial, Subversion)
- many reliability improvments (SHORTEN_PATH feature)
Ready for a release.
      Also changed the test.sh to reflect new feature
@dolmen
Copy link
Collaborator

dolmen commented Jan 19, 2014

Please never merge the branches from the main repo to your own feature branches. This pull request is a mess now.

@dolmen
Copy link
Collaborator

dolmen commented Feb 20, 2014

We got an other implementation of this feature in #277, and those patches are cleaner.

@berserck Could you check if #277 would fit your needs?

@thoraxe
Copy link

thoraxe commented Feb 21, 2014

@dolmen My implementation won't work for @berserck because I am using Bash's \H which he claims does not work on 100% of platforms.

You have to make a decision about whether or not you want to 100% rely on the underlying shell's prompt options or if you want to go "outside" the box if the prompt's options fail.

In other words, in my opinion, if \H doesn't work on your platform, you need to file a bug against the prompt on your platform because it should work. That's why I implemented it this way.

Sorry I didn't write any tests. I am not so good with testing.

@berserck
Copy link
Author

that is correct, feature #277 will not work for me.

I found out why the option \H does not work for me and it has to do with my setup, it is not a bash problem, but it seems to be one of those things that will not change soon (more information in http://serverfault.com/questions/296970/bash-prompt-on-ubuntu-fqdn-h-same-as-hostname-h)

the option hostname -f seems to be better in terms of results(you will get what you expect), the \H is the bash native.

you can go either way.
Sorry for the mess with the commits, but I'll not have time to re-d0/clean up in the near future.

@dolmen
Copy link
Collaborator

dolmen commented Feb 24, 2014

Thanks for the feedback. I'll try to do a mix of the two implementations.

@dolmen dolmen added duplicate needs work Needs changes before merge is possible labels Nov 4, 2015
@dolmen
Copy link
Collaborator

dolmen commented Nov 4, 2015

FQDN feature from #254 is in merged 695d629.
Thanks for being patient!

Note to self: the changes in the testsuite in this PR would be interesting to merge...

@dolmen dolmen closed this Nov 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate enhancement Feature request hostname Related to the hostname lookup or display needs work Needs changes before merge is possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants