sbstp / kubie

A more powerful alternative to kubectx and kubens
https://blog.sbstp.ca/introducing-kubie/
zlib License
2.03k stars 102 forks source link

Bug: disable prompt info on ZSH doesn't work #95

Open darek-mydlarz opened 2 years ago

darek-mydlarz commented 2 years ago

Hello!

Despite disabling prompt information in the ~/.kube/kubie.yaml file, the information is still printed to the console. I have reloaded the shell.

       │ File: /Users/dariuszmydlarz/.kube/kubie.yaml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ # Force kubie to use a particular shell, if unset detect shell currently in use.
   2   │ # Possible values: bash, dash, fish, xonsh, zsh
   3   │ # Default: unset
   4   │ shell: zsh
   5   │
   6   │ # Configure where to look for kubernetes config files.
   7   │ configs:
   8   │
   9   │     # Include these globs.
  10   │     # Default: values listed below.
  11   │     include:
  12   │         - ~/.kube/config
  13   │         - ~/.kube/*.yml
  14   │         - ~/.kube/*.yaml
  15   │         - ~/.kube/configs/*.yml
  16   │         - ~/.kube/configs/*.yaml
  17   │         - ~/.kube/kubie/*.yml
  18   │         - ~/.kube/kubie/*.yaml
  19   │
  20   │     # Exclude these globs.
  21   │     # Default: values listed below.
  22   │     # Note: kubie's own config file is always excluded.
  23   │     exclude:
  24   │         - ~/.kube/kubie.yaml
  25   │
  26   │ # Prompt settings.
  27   │ prompt:
  28   │     # Disable kubie's custom prompt inside of a kubie shell. This is useful
  29   │     # when you already have a prompt displaying kubernetes information.
  30   │     # Default: false
  31   │     disable: true
$ echo "123"
123
[k8s-context|my-app-namespace]

I want to get rid of those last line printed which has appeared after installing kubie on my machine.

I use MacOS with ZSH + Oh-My-ZSH.

muchgitsuchwow commented 2 years ago

With p10k running kubie ctx spawns a new shell, which is a very good idea, but seems to dismiss the shells configuration, which is a bad idea, and starts p10k configure dialog for me. My hope was that

prompt:
  disable: true

would address that. It didn't. If that was the intension I'd be very glad to have this one fixed.

pandvan commented 2 months ago

Facing a same issue here. Zsh + p10k When I start a new shell with kubie ctx and prompt disable, the prompt on the new shell is a bloat of strings like

${$((_p9k_on_expand()))+}${_p9k__raw_msg-}${_p9k__raw_msg::=}${(e)_p9k_t[7]}${_p9k__1-${${:-${_p9k__d::=0}${_p9k__rprompt::=${_p9k__1r-${${:-${_p9k__bg::=NONE}${_p9k__i::=0}${_p9k__sss::=}}+}${${:-${P9K_CONTENT::=}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=8}}${_p9k__n:=${${(M)${:-x$_p9k__bg}:#x(236|236)}:+10}}${_p9k__n:=11}${_p9k__c::="${P9K_CONTENT}"}${_p9k}}${_p9k__e::=${${_p9k__1r:+00}:-${${():-$_p9k__c1}[-1]}0}}}+}${${_p9k__e:#00}:+${_p9k_t[$_p9k__n]/<_p9k__w>/$_p9k__w}${_p9k__c}${${:-${_p9k__w::= }${_p9k__sss::= }${_p9k__i::=1}${_p9k__bg::=236}}+}}${${:-"${${():-0}:#0}"}:+${${:-${P9K_CONTENT::=""}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=12}}${_p9k__n:=${${(M)${:-x$_p9k__bg}:#x(236|236)}:+14}}${_p9k__n:=15}}${_p9k__e::=${${_p9k__1rbackground_jobs+00}:-${${():-$_p9k__c1}[-1]}1}}}+}${${_p9k__e:#00}:+${_p9k_t[$_p9k__n]/<_p9k__w>/$_p9k__w}${_p9k__c}${${(M)_p9k__e:#11}:+ }$_p9k__v${${:-${_p9k__w::= } [...]