1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2026-07-11 23:46:44 +02:00

22 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] c95203294b fix(jonathan): avoid unicode box-drawing in ghostty 2026-05-27 08:29:16 +00:00
copilot-swe-agent[bot] 7b4ce37547 Initial plan 2026-05-27 08:22:59 +00:00
Oliver Jahren fe11a3ae23 fix(dnf): use --installed to support dnf 4 and 5 (#13772) 2026-05-27 10:22:10 +02:00
Sediman AI 87a9b16b72 fix(alias-finder): use ? quantifier for BSD compat (#13774)
Co-authored-by: Sediman <jason@sediman.com>
2026-05-27 10:16:00 +02:00
OKWN 857a646516 docs(tt): rename README.MD to README.md (#13773) 2026-05-27 10:02:17 +02:00
dependabot[bot] 5ef67beadb chore(deps): bump github/codeql-action from 4.35.5 to 4.36.0 (#13767)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-26 10:12:39 +02:00
dependabot[bot] d633270784 chore(deps): bump step-security/harden-runner from 2.19.3 to 2.19.4 (#13768)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-26 10:12:19 +02:00
ohmyzsh[bot] 43c68566be chore(kube-ps1): update to 04af46f7 2026-05-24 14:41:59 +02:00
Md Mushfiqur Rahim cb64103161 fix(aliases): preserve trailing double quotes in als output (#13744)
Co-authored-by: Codebuff Contributor <contributor@codebuff.com>
2026-05-18 09:00:15 +02:00
Masaru Iritani 0eecd2821e fix(tmux): respect ZSH_TMUX_UNICODE in tds (#13741) 2026-05-18 08:51:48 +02:00
rock2z 2a5313a9d0 docs(git): document missing aliases (#13742) 2026-05-18 08:51:23 +02:00
Kaspar V. 24959d5817 feat(pass-cli): add completions plugin (#13740) 2026-05-18 08:47:51 +02:00
dependabot[bot] efd6135bf5 chore(deps): bump step-security/harden-runner from 2.19.1 to 2.19.3 (#13755)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-18 08:45:12 +02:00
dependabot[bot] c68e752b1b chore(deps): bump idna from 3.13 to 3.15 in /.github/workflows/dependencies (#13754)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-18 08:44:51 +02:00
dependabot[bot] 8d0ff417c3 chore(deps): bump github/codeql-action from 4.35.4 to 4.35.5 (#13751)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-18 08:44:28 +02:00
dependabot[bot] 80a6f169c7 chore(deps): bump requests from 2.33.1 to 2.34.2 in /.github/workflows/dependencies (#13752)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-18 08:44:05 +02:00
dependabot[bot] c4e39ad56b chore(deps): bump actions/create-github-app-token from 3.1.1 to 3.2.0 (#13753)
Signed-off-by: dependabot[bot] <support@github.com>
2026-05-18 08:43:53 +02:00
ohmyzsh[bot] 7478f1fd22 chore(kube-ps1): update to 7d575c6d (#13750)
Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
2026-05-17 11:58:14 +02:00
dependabot[bot] a07126330b chore(deps): bump github/codeql-action from 4.35.3 to 4.35.4 (#13737)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.35.3 to 4.35.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e46ed2cbd01164d986452f91f178727624ae40d7...68bde559dea0fdcac2102bfdf6230c5f70eb485e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-11 11:00:26 +02:00
dependabot[bot] 1381fec0bf chore(deps): bump urllib3 from 2.6.3 to 2.7.0 in /.github/workflows/dependencies (#13738)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.6.3 to 2.7.0.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-11 11:00:05 +02:00
Laurens Rouw 3604dc23e0 feat(jj): add new alias for new bookmark advance command (#13638) 2026-05-06 11:42:33 -07:00
ChrisJr404 8ab16fa493 docs(brew): correct brews description (#13730) 2026-05-06 14:34:32 +02:00
22 changed files with 124 additions and 55 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ dependencies:
plugins/kube-ps1:
repo: jonmosco/kube-ps1
branch: master
version: e19c9ee867c5655814c384a6bf543e330e6ef1b7
version: 04af46f7fe888ad287abcab6699b9bb10234bc3d
precopy: |
set -e
find . ! -name kube-ps1.sh ! -name LICENSE ! -name README.md -delete
+2 -2
View File
@@ -16,7 +16,7 @@ jobs:
contents: write # this is needed to push commits and branches
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
@@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
- name: Authenticate as @ohmyzsh
id: generate-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
@@ -1,7 +1,7 @@
certifi==2026.4.22
charset-normalizer==3.4.7
idna==3.13
idna==3.15
PyYAML==6.0.3
requests==2.33.1
requests==2.34.2
semver==3.0.4
urllib3==2.6.3
urllib3==2.7.0
+2 -2
View File
@@ -26,7 +26,7 @@ jobs:
- macos-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
@@ -47,7 +47,7 @@ jobs:
- test
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
if: github.repository == 'ohmyzsh/ohmyzsh'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
+2 -2
View File
@@ -17,12 +17,12 @@ jobs:
if: github.repository == 'ohmyzsh/ohmyzsh'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Authenticate as @ohmyzsh
id: generate-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
+2 -2
View File
@@ -36,7 +36,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
@@ -60,6 +60,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
uses: github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
with:
sarif_file: results.sarif
+2 -2
View File
@@ -1,5 +1,5 @@
alias-finder() {
local cmd=" " exact="" longer="" cheaper="" wordEnd="'{0,1}$" finder="" filter=""
local cmd=" " exact="" longer="" cheaper="" wordEnd="'?$" finder="" filter=""
# build command and options
for c in "$@"; do
@@ -31,7 +31,7 @@ alias-finder() {
# find with alias and grep, removing last word each time until no more words
while [[ $cmd != "" ]]; do
finder="'{0,1}$cmd$wordEnd"
finder="'?$cmd$wordEnd"
# make filter to find only shorter results than current cmd
if [[ $cheaper == true ]]; then
+3 -1
View File
@@ -6,7 +6,9 @@ import argparse
def parse(line):
left = line[0:line.find('=')].strip()
right = line[line.find('=')+1:].strip('\'"\n ')
right = line[line.find('=')+1:].strip('\n ')
if len(right) >= 2 and right[0] == right[-1] and right[0] in '\'"':
right = right[1:-1]
try:
cmd = next(part for part in right.split() if len([char for char in '=<>' if char in part])==0)
except StopIteration:
+1 -1
View File
@@ -40,7 +40,7 @@ the `brew` binary before sourcing `oh-my-zsh.sh` and it'll set up the environmen
| `bo` | `brew outdated` | List installed formulae that have an updated version available. |
| `br` | `brew reinstall` | Reinstall a formula. |
| `brewp` | `brew pin` | Pin a specified formula so that it's not upgraded. |
| `brews` | `brew list -1` | List installed formulae or the installed files for a given formula. |
| `brews` | _function_ | List installed leaf formulae with their dependencies, then casks. |
| `brewsp` | `brew list --pinned` | List pinned formulae, or show the version of a given formula. |
| `brh` | `brew reinstall --HEAD` | Reinstall a formula with --HEAD |
| `bs` | `brew search` | Perform a substring search of cask tokens and formula names for text. |
+1 -1
View File
@@ -18,7 +18,7 @@ of `dnf5` and uses it as drop-in alternative to the slower `dnf`.
| Alias | Command | Description |
|-------|-------------------------|--------------------------|
| dnfl | `dnf list` | List packages |
| dnfli | `dnf list installed` | List installed packages |
| dnfli | `dnf list --installed` | List installed packages |
| dnfgl | `dnf grouplist` | List package groups |
| dnfmc | `dnf makecache` | Generate metadata cache |
| dnfp | `dnf info` | Show package information |
+1 -1
View File
@@ -5,7 +5,7 @@ local dnfprog="dnf"
command -v dnf5 > /dev/null && dnfprog=dnf5
alias dnfl="${dnfprog} list" # List packages
alias dnfli="${dnfprog} list installed" # List installed packages
alias dnfli="${dnfprog} list --installed" # List installed packages
alias dnfmc="${dnfprog} makecache" # Generate metadata cache
alias dnfp="${dnfprog} info" # Show package information
alias dnfs="${dnfprog} search" # Search package
+3
View File
@@ -181,6 +181,8 @@ plugins=(... git)
| `grst` | `git restore --staged` |
| `gunwip` | `git rev-list --max-count=1 --format="%s" HEAD \| grep -q "--wip--" && git reset HEAD~1` |
| `grev` | `git revert` |
| `greva` | `git revert --abort` |
| `grevc` | `git revert --continue` |
| `grm` | `git rm` |
| `grmc` | `git rm --cached` |
| `gcount` | `git shortlog --summary -n` |
@@ -215,6 +217,7 @@ plugins=(... git)
| `gunignore` | `git update-index --no-assume-unchanged` |
| `gwch` | `git log --patch --abbrev-commit --pretty=medium --raw` |
| `gwt` | `git worktree` |
| `gwta` | `git worktree add` |
| `gwtls` | `git worktree list` |
| `gwtmv` | `git worktree move` |
| `gwtrm` | `git worktree remove` |
+1
View File
@@ -14,6 +14,7 @@ plugins=(... jj)
| ------ | ----------------------------- |
| jja | `jj abandon` |
| jjb | `jj bookmark` |
| jjba | `jj bookmark advance` |
| jjbc | `jj bookmark create` |
| jjbd | `jj bookmark delete` |
| jjbf | `jj bookmark forget` |
+1
View File
@@ -36,6 +36,7 @@ function jj_prompt_template() {
# Aliases (sorted alphabetically)
alias jja='jj abandon'
alias jjb='jj bookmark'
alias jjba='jj bookmark advance'
alias jjbc='jj bookmark create'
alias jjbd='jj bookmark delete'
alias jjbf='jj bookmark forget'
+18 -5
View File
@@ -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 |
| :------- | :-----: | ------- |
+43 -29
View File
@@ -49,7 +49,7 @@ _kube_ps1_shell_type() {
elif [ "${BASH_VERSION-}" ]; then
_KUBE_PS1_SHELL_TYPE="bash"
fi
echo $_KUBE_PS1_SHELL_TYPE
echo "$_KUBE_PS1_SHELL_TYPE"
}
_kube_ps1_init() {
@@ -65,6 +65,15 @@ _kube_ps1_init() {
_KUBE_PS1_TPUT_AVAILABLE=false
fi
# Detect stat type once (not needed for zsh which uses zstat builtin)
if [[ "${_KUBE_PS1_SHELL}" != "zsh" ]]; then
if stat -c "%s" /dev/null &> /dev/null; then
_KUBE_PS1_STAT_TYPE="gnu"
else
_KUBE_PS1_STAT_TYPE="bsd"
fi
fi
case "${_KUBE_PS1_SHELL}" in
"zsh")
_KUBE_PS1_OPEN_ESC="%{"
@@ -98,8 +107,8 @@ _kube_ps1_color_fg() {
magenta) _KUBE_PS1_FG_CODE=5;;
cyan) _KUBE_PS1_FG_CODE=6;;
white) _KUBE_PS1_FG_CODE=7;;
# 256
[0-9]|[1-9][0-9]|[1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-6]) _KUBE_PS1_FG_CODE="${1}";;
# 256 colors
[0-9]|[1-9][0-9]|[1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]) _KUBE_PS1_FG_CODE="${1}";;
*) _KUBE_PS1_FG_CODE=default
esac
@@ -111,7 +120,7 @@ _kube_ps1_color_fg() {
elif [[ "${_KUBE_PS1_SHELL}" == "bash" ]]; then
if [[ "${_KUBE_PS1_TPUT_AVAILABLE}" == "true" ]]; then
_KUBE_PS1_FG_CODE="$(tput setaf "${_KUBE_PS1_FG_CODE}")"
elif [[ $_KUBE_PS1_FG_CODE -ge 0 ]] && [[ $_KUBE_PS1_FG_CODE -le 256 ]]; then
elif [[ $_KUBE_PS1_FG_CODE -ge 0 ]] && [[ $_KUBE_PS1_FG_CODE -le 255 ]]; then
_KUBE_PS1_FG_CODE="\033[38;5;${_KUBE_PS1_FG_CODE}m"
else
_KUBE_PS1_FG_CODE="${_KUBE_PS1_DEFAULT_FG}"
@@ -131,20 +140,20 @@ _kube_ps1_color_bg() {
magenta) _KUBE_PS1_BG_CODE=5;;
cyan) _KUBE_PS1_BG_CODE=6;;
white) _KUBE_PS1_BG_CODE=7;;
# 256
[0-9]|[1-9][0-9]|[1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-6]) _KUBE_PS1_BG_CODE="${1}";;
*) _KUBE_PS1_BG_CODE=$'\033[0m';;
# 256 colors
[0-9]|[1-9][0-9]|[1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]) _KUBE_PS1_BG_CODE="${1}";;
*) _KUBE_PS1_BG_CODE=default
esac
if [[ "${_KUBE_PS1_BG_CODE}" == "default" ]]; then
_KUBE_PS1_FG_CODE="${_KUBE_PS1_DEFAULT_BG}"
_KUBE_PS1_BG_CODE="${_KUBE_PS1_DEFAULT_BG}"
return
elif [[ "${_KUBE_PS1_SHELL}" == "zsh" ]]; then
_KUBE_PS1_BG_CODE="%K{$_KUBE_PS1_BG_CODE}"
elif [[ "${_KUBE_PS1_SHELL}" == "bash" ]]; then
if [[ "${_KUBE_PS1_TPUT_AVAILABLE}" == "true" ]]; then
_KUBE_PS1_BG_CODE="$(tput setab "${_KUBE_PS1_BG_CODE}")"
elif [[ $_KUBE_PS1_BG_CODE -ge 0 ]] && [[ $_KUBE_PS1_BG_CODE -le 256 ]]; then
elif [[ $_KUBE_PS1_BG_CODE -ge 0 ]] && [[ $_KUBE_PS1_BG_CODE -le 255 ]]; then
_KUBE_PS1_BG_CODE="\033[48;5;${_KUBE_PS1_BG_CODE}m"
else
_KUBE_PS1_BG_CODE="${_KUBE_PS1_DEFAULT_BG}"
@@ -154,7 +163,7 @@ _kube_ps1_color_bg() {
}
_kube_ps1_binary_check() {
command -v $1 >/dev/null
command -v "$1" >/dev/null
}
_kube_ps1_symbol() {
@@ -171,6 +180,7 @@ _kube_ps1_symbol() {
local oc_glyph=$'\ue7b7'
local oc_symbol_color=red
local custom_symbol_color="${KUBE_PS1_SYMBOL_COLOR:-$k8s_symbol_color}"
local KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_CLOSE_ESC}"
# Choose the symbol based on the provided argument or environment variable
case "${symbol_arg}" in
@@ -225,15 +235,27 @@ _kube_ps1_file_newer_than() {
if [[ "${_KUBE_PS1_SHELL}" == "zsh" ]]; then
# Use zstat '-F %s.%s' to make it compatible with low zsh version (eg: 5.0.2)
mtime=$(zstat -L +mtime -F %s.%s "${file}")
elif stat -c "%s" /dev/null &> /dev/null; then
# GNU stat
elif [[ "${_KUBE_PS1_STAT_TYPE}" == "gnu" ]]; then
mtime=$(stat -L -c %Y "${file}")
else
# BSD stat
mtime=$(stat -L -f %m "$file")
fi
[[ "${mtime}" -gt "${check_time}" ]]
[[ "${mtime}" -gt "${check_time}" ]] && return 0
# If the path is a symlink, also check the symlink's own mtime
if [[ -L "${file}" ]]; then
if [[ "${_KUBE_PS1_SHELL}" == "zsh" ]]; then
mtime=$(zstat +mtime -F %s.%s "${file}")
elif [[ "${_KUBE_PS1_STAT_TYPE}" == "gnu" ]]; then
mtime=$(stat -c %Y "${file}")
else
mtime=$(stat -f %m "$file")
fi
[[ "${mtime}" -gt "${check_time}" ]] && return 0
fi
return 1
}
_kube_ps1_prompt_update() {
@@ -280,7 +302,6 @@ _kube_ps1_prompt_update() {
_kube_ps1_get_context() {
if [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]]; then
KUBE_PS1_CONTEXT="$(${KUBE_PS1_BINARY} config current-context 2>/dev/null)"
# Set namespace to 'N/A' if it is not defined
KUBE_PS1_CONTEXT="${KUBE_PS1_CONTEXT:-N/A}"
if [[ -n "${KUBE_PS1_CLUSTER_FUNCTION}" ]]; then
@@ -303,7 +324,7 @@ _kube_ps1_get_ns() {
_kube_ps1_get_context_ns() {
# Set the command time
if [[ "${_KUBE_PS1_SHELL}" == "bash" ]]; then
if ((BASH_VERSINFO[0] >= 4 && BASH_VERSINFO[1] >= 2)); then
if ((BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 2))); then
_KUBE_PS1_LAST_TIME=$(printf '%(%s)T')
else
_KUBE_PS1_LAST_TIME=$(date +%s)
@@ -312,9 +333,6 @@ _kube_ps1_get_context_ns() {
_KUBE_PS1_LAST_TIME=$EPOCHREALTIME
fi
KUBE_PS1_CONTEXT="${KUBE_PS1_CONTEXT:-N/A}"
KUBE_PS1_NAMESPACE="${KUBE_PS1_NAMESPACE:-N/A}"
# Cache which cfgfiles we can read in case they change.
local conf
_KUBE_PS1_CFGFILES_READ_CACHE=
@@ -358,12 +376,13 @@ EOF
kubeon() {
if [[ "${1}" == '-h' || "${1}" == '--help' ]]; then
_kubeon_usage
return 0
elif [[ "${1}" == '-g' || "${1}" == '--global' ]]; then
rm -f -- "${_KUBE_PS1_DISABLE_PATH}"
elif [[ "$#" -ne 0 ]]; then
echo -e "error: unrecognized flag ${1}\\n"
echo -e "error: unrecognized flag ${1}\\n" >&2
_kubeon_usage
return
return 1
fi
KUBE_PS1_ENABLED=on
@@ -372,13 +391,14 @@ kubeon() {
kubeoff() {
if [[ "${1}" == '-h' || "${1}" == '--help' ]]; then
_kubeoff_usage
return 0
elif [[ "${1}" == '-g' || "${1}" == '--global' ]]; then
mkdir -p -- "$(dirname "${_KUBE_PS1_DISABLE_PATH}")"
touch -- "${_KUBE_PS1_DISABLE_PATH}"
elif [[ $# -ne 0 ]]; then
echo "error: unrecognized flag ${1}" >&2
echo -e "error: unrecognized flag ${1}\\n" >&2
_kubeoff_usage
return
return 1
fi
KUBE_PS1_ENABLED=off
@@ -390,15 +410,9 @@ kube_ps1() {
[[ -z "${KUBE_PS1_CONTEXT}" ]] && [[ "${KUBE_PS1_CONTEXT_ENABLE}" == true ]] && return
[[ "${KUBE_PS1_CONTEXT}" == "N/A" ]] && [[ ${KUBE_PS1_HIDE_IF_NOCONTEXT} == true ]] && return
local KUBE_PS1
local KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_CLOSE_ESC}"
# If background color is set, reset color should also reset the background
# if [[ -n "${KUBE_PS1_BG_COLOR}" ]]; then
# KUBE_PS1_RESET_COLOR="${_KUBE_PS1_OPEN_ESC}${_KUBE_PS1_DEFAULT_FG}${_KUBE_PS1_DEFAULT_BG}${_KUBE_PS1_CLOSE_ESC}"
# fi
# Background Color
[[ -n "${KUBE_PS1_BG_COLOR}" ]] && KUBE_PS1+="$(_kube_ps1_color_bg "${KUBE_PS1_BG_COLOR}")"
+11
View File
@@ -0,0 +1,11 @@
# Proton Pass CLI plugin
This plugin adds completions for [Proton Pass CLI](https://protonpass.github.io/pass-cli/).
To use it, add `pass-cli` to the plugins array in your zshrc file:
```zsh
plugins=(... pass-cli)
```
This plugin does not add any aliases.
+14
View File
@@ -0,0 +1,14 @@
# Autocompletion for Proton Pass CLI (pass-cli)
if (( ! $+commands[pass-cli] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `pass-cli`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_pass-cli" ]]; then
typeset -g -A _comps
autoload -Uz _pass-cli
_comps[pass-cli]=_pass-cli
fi
pass-cli completions zsh >| "$ZSH_CACHE_DIR/completions/_pass-cli" &|
+4 -1
View File
@@ -183,7 +183,10 @@ function _tmux_directory_session() {
# human friendly unique session name for this directory
local session_name="${dir}-${md5:0:6}"
# create or attach to the session
tmux new -As "$session_name"
local -a tmux_cmd
tmux_cmd=(command tmux)
[[ "$ZSH_TMUX_UNICODE" == "true" ]] && tmux_cmd+=(-u)
$tmux_cmd new -As "$session_name"
}
alias tds=_tmux_directory_session
+8 -1
View File
@@ -60,7 +60,14 @@ ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} %{%G═%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} %{%G✭%}"
# Use extended characters to look nicer if supported.
if [[ "${langinfo[CODESET]}" = UTF-8 ]]; then
if [[ "${TERM_PROGRAM:-}" = ghostty ]]; then
PR_SET_CHARSET=""
PR_HBAR="-"
PR_ULCORNER="-"
PR_LLCORNER="-"
PR_LRCORNER="-"
PR_URCORNER="-"
elif [[ "${langinfo[CODESET]}" = UTF-8 ]]; then
PR_SET_CHARSET=""
PR_HBAR="─"
PR_ULCORNER="┌"