mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
Merge pull request #214 from noseglid/master
Simplify kubernetes context fetching
This commit is contained in:
commit
dbe3009b02
@ -121,6 +121,7 @@ set -g theme_newline_prompt '$ '
|
||||
- `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported.
|
||||
- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator.
|
||||
- `theme_display_k8s_context`. This feature is disabled by default. Use `yes` to show the current kubernetes context (`> kubectl config current-context`).
|
||||
- `theme_display_k8s_namespace`. This feature is disabled by default. Use `yes` to show the current kubernetes namespace.
|
||||
- `theme_display_user`. If set to `yes`, display username always, if set to `ssh`, only when an SSH-Session is detected, if set to no, never.
|
||||
- `theme_display_hostname`. Same behaviour as `theme_display_user`.
|
||||
- `theme_display_sudo_user`. If set to `yes`, displays the sudo-username in a root shell. For example, when calling `sudo -s` and having this option set to `yes`, the username of the user, who called `sudo -s`, will be displayed.
|
||||
|
@ -28,6 +28,7 @@
|
||||
# set -g theme_display_vagrant yes
|
||||
# set -g theme_display_docker_machine no
|
||||
# set -g theme_display_k8s_context yes
|
||||
# set -g theme_display_k8s_namespace no
|
||||
# set -g theme_display_hg yes
|
||||
# set -g theme_display_virtualenv no
|
||||
# set -g theme_display_ruby no
|
||||
@ -639,7 +640,8 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context'
|
||||
set -l context (__bobthefish_k8s_context)
|
||||
or return
|
||||
|
||||
set -l namespace (__bobthefish_k8s_namespace)
|
||||
[ "$theme_display_k8s_namespace" = 'yes' ]
|
||||
and set -l namespace (__bobthefish_k8s_namespace)
|
||||
|
||||
set -l segment $k8s_glyph " " $context
|
||||
[ -n "$namespace" ]
|
||||
|
Loading…
Reference in New Issue
Block a user