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

kubie doesn't restore ZDOTDIR #132

Closed
BeyondEvil opened this issue May 12, 2023 · 3 comments · Fixed by #192 · May be fixed by #183
Closed

kubie doesn't restore ZDOTDIR #132

BeyondEvil opened this issue May 12, 2023 · 3 comments · Fixed by #192 · May be fixed by #183

Comments

@BeyondEvil
Copy link

Before running kubie:

❯ echo $ZDOTDIR
/home/jim/.config/zsh

after:

❯ kubie ctx
/home/jim/.config/zsh/.zshrc:25: no matches found: /tmp/.tmprv8lQW/plugins/*
LT-19FFX6% echo $ZDOTDIR
/tmp/.tmprv8lQW
LT-19FFX6%
.kube/kubie.yaml

# Force kubie to use a particular shell, if unset detect shell currently in use.
# Possible values: bash, dash, fish, xonsh, zsh
# Default: unset
shell: zsh

# Configure where to look for kubernetes config files.
configs:

    # Include these globs.
    # Default: values listed below.
    include:
        - ~/.kube/config
        - ~/.kube/*.yml
        - ~/.kube/*.yaml
        - ~/.kube/configs/*.yml
        - ~/.kube/configs/*.yaml
        - ~/.kube/kubie/*.yml
        - ~/.kube/kubie/*.yaml

    # Exclude these globs.
    # Default: values listed below.
    # Note: kubie's own config file is always excluded.
    exclude:
        - ~/.kube/kubie.yaml

# Prompt settings.
prompt:
    # Disable kubie's custom prompt inside of a kubie shell. This is useful
    # when you already have a prompt displaying kubernetes information.
    # Default: false
    disable: true

    # When using recursive contexts, show depth when larger than 1.
    # Default: true
    show_depth: true

    # When using zsh, show context and namespace on the right-hand side using RPS1.
    # Default: false
    zsh_use_rps1: false

    # When using fish, show context and namespace on the right-hand side.
    # Default: false
    fish_use_rprompt: false

    # When using xonsh, show context and namespace on the right-hand side.
    # Default: false
    xonsh_use_right_prompt: false

# Behavior
behavior:
    # Make sure the namespace exists with `kubectl get namespaces` when switching
    # namespaces. If you do not have the right to list namespaces, disable this.
    # Default: true
    validate_namespaces: true

    # Enable or disable the printing of the 'CONTEXT => ...' headers when running
    # `kubie exec`.
    # Valid values:
    #   auto:   Prints context headers only if stdout is a TTY. Piping/redirecting
    #           kubie output will auto-disable context headers.
    #   always: Always prints context headers, even if stdout is not a TTY.
    #   never:  Never prints context headers.
    # Default: auto
    print_context_in_exec: auto

❯ cat .zshenv
export ZDOTDIR=~/.config/zsh
[[ -f $ZDOTDIR/.zshenv ]] && . $ZDOTDIR/.zshenv
.config/zsh/.zshrc

HISTSIZE=5000
HISTFILE=$ZDOTDIR/.zsh_history
SAVEHIST=5000
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt incappendhistory
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export PYTHONDONTWRITEBYTECODE=1

autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit

# case-insensitivity
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'

# source zsh plugins
for plugin in "${ZDOTDIR}"/plugins/*; do
  name=$(basename "${plugin}")
  _source="${plugin}/${name}.zsh"
  [[ -s "${_source}" ]] && source "${plugin}/${name}.zsh"
done

fpath+="${ZDOTDIR}"/plugins/zsh-completions/src

alias k="kubectl"
alias h="helm"
alias ls="ls -la --color=tty"

eval "$(direnv hook zsh)"

eval "$(starship init zsh)"

# Created by `pipx` on 2023-03-29 11:16:45
export PATH="$PATH:/home/jim/.local/bin"

~
❯ cat .config/zsh/.zprofile
export DEV=~/dev

path=(
  ~/bin
  $path
)

# Created by `pipx` on 2023-03-29 11:16:45
export PATH="$PATH:/home/jim/.local/bin"
@CharlesB2
Copy link

Could it be the culprit in the fact that I'm losing ZSH history after each kubie session?

@BeyondEvil
Copy link
Author

Possibly.

How can I help?

@Zebradil
Copy link
Contributor

Could you check if #192 fixes the issue?

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

Successfully merging a pull request may close this issue.

3 participants