Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

add ability to toggle prompt by "kube_ps" without flags #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ function fish_prompt
end
```

Finally, enable the prompt by executing this once (the setting will be preserved
across restarts of the shell.)

```fish
kube_fs
```

## Speed

Running the `kubectl` commands to get the context and namespace every time
Expand All @@ -38,6 +45,11 @@ This was not my idea, I took it from `jonmosco/kube-ps1`.

You can toggle the prompt on or off like this:

```fish
kube_ps
```

You can enable or disable the prompt like this:
```fish
kube_ps on
kube_ps off
Expand Down
8 changes: 8 additions & 0 deletions functions/kube_ps.fish
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ function kube_ps -a toggle
set -U __kube_ps_enabled 0
return
end

if test "$__kube_ps_enabled" = 1
set -U __kube_ps_enabled 0
return
end

set -U __kube_ps_enabled 1

end