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

Include domain or IP in bash prompt #40

Closed
ocean90 opened this issue Jan 19, 2017 · 10 comments
Closed

Include domain or IP in bash prompt #40

ocean90 opened this issue Jan 19, 2017 · 10 comments

Comments

@ocean90
Copy link
Collaborator

ocean90 commented Jan 19, 2017

@ocean90
Copy link
Collaborator Author

ocean90 commented Jan 19, 2017

deploy@compute-01 ~ % cat .zshrc
# Set up the prompt

autoload -Uz promptinit
promptinit
prompt adam1

Checked some of the other themes, none of them are using \H for the host, which is the placeholder for the fully qualified domain name (or FQDN).

deploy@compute-01 ~ % hostname
compute-01
deploy@compute-01 ~ % hostname -f
compute-01.ch.example.ch

@ivomarino
Copy link
Member

we should define a file in etc with some vars to source

@ivomarino
Copy link
Member

ivomarino commented Jan 19, 2017

@ocean90
Copy link
Collaborator Author

ocean90 commented Feb 1, 2017

Quote from GitLab.com Database Incident:

TODO after data restored:

  • Create issue to change terminal PS1 format/colours to make it clear whether you’re using production or staging (red production, yellow staging)
  • Show the full hostname in the bash prompt for all users by default (e.g., “db1.staging.gitlab.com” instead of just “db1”)

@ivomarino
Copy link
Member

one idea is to leave hostname like it is:

user@compute-01

but change the color:

  • green: development
  • blue: testing
  • yellow: staging
  • red: production

@ocean90 what do you think?

@ocean90
Copy link
Collaborator Author

ocean90 commented Feb 2, 2017

Would user@compute-01 [staging] (plus color) work too?

@ivomarino
Copy link
Member

@ocean90 could be an option, basic idea is to keep the prompt as short as possible so maybe:

user@compute-01 [dev]
user@compute-01 [test]
user@compute-01 [stage]
user@compute-01 [prod]

I would suggest to start by grades, so first color, if we see it's not sufficient let's add also the suffix, ok?

@ocean90
Copy link
Collaborator Author

ocean90 commented Feb 2, 2017

Isn't it possible to disable or change colors? That's what I see in iTerm:

bildschirmfoto 2017-02-02 um 12 21 31

Colors are probably fine for the start but I always prefer text as it's more accessible. Don't forget that there are people with red–green color blindness. :)

@ivomarino
Copy link
Member

True, also: http://serverfault.com/a/323155 ;)

@ivomarino
Copy link
Member

For now I won't implement this, if someone would like to take it over feel free to open a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants