diff --git a/.github/dependencies.yml b/.github/dependencies.yml index b59cf9ed0..254196920 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -30,7 +30,7 @@ dependencies: plugins/kube-ps1: repo: jonmosco/kube-ps1 branch: master - version: e19c9ee867c5655814c384a6bf543e330e6ef1b7 + version: 7d575c6d53f60130159a3db28e33d2967201cd64 precopy: | set -e find . ! -name kube-ps1.sh ! -name LICENSE ! -name README.md -delete diff --git a/plugins/kube-ps1/README.md b/plugins/kube-ps1/README.md index ef6d781ad..5ab059354 100644 --- a/plugins/kube-ps1/README.md +++ b/plugins/kube-ps1/README.md @@ -1,10 +1,9 @@ -# kube-ps1: Kubernetes prompt for bash and zsh +# kube-ps1: Kubernetes prompt for bash, zsh, and fish ![GitHub Release](https://img.shields.io/github/v/release/jonmosco/kube-ps1) [![CI](https://github.com/jonmosco/kube-ps1/actions/workflows/ci.yml/badge.svg)](https://github.com/jonmosco/kube-ps1/actions/workflows/ci.yml) -A script that lets you add the current Kubernetes context and namespace -configured on `kubectl` to your Bash/Zsh prompt strings (i.e. the `$PS1`). +A script that lets you add the current Kubernetes context and namespace configured on `kubectl` to your Bash, Zsh, or Fish prompt. Inspired by several tools used to simplify usage of `kubectl`. @@ -77,6 +76,21 @@ source /path/to/kube-ps1.sh PS1='[\u@\h \W $(kube_ps1)]\$ ' ``` +#### Fish + +Add this to `~/.config/fish/config.fish`: + +```fish +source /path/to/kube-ps1.fish + +function fish_prompt + echo -n (kube_ps1) ' ' + # your existing prompt here +end +``` + +> Note: Fish users should source `kube-ps1.fish` instead of `kube-ps1.sh`. + ## Requirements The default prompt assumes you have the `kubectl` command line utility installed. @@ -184,8 +198,7 @@ If the font is not properly installed, and the glyph is not available, it will d ## Customization -The default settings can be overridden in `~/.bashrc` or `~/.zshrc` by setting -the following variables: +The default settings can be overridden in `~/.bashrc`, `~/.zshrc`, or `~/.config/fish/config.fish` by setting the following variables: | Variable | Default | Meaning | | :------- | :-----: | ------- |