Spaceship-prompt: kubecontext default color not set

Created on 11 Dec 2018  路  3Comments  路  Source: denysdovhan/spaceship-prompt

Introduced with #576

Default value of SPACESHIP_KUBECONTEXT_COLOR_GROUPS sets the color to () and overrides SPACESHIP_KUBECONTEXT_COLOR.

Current behavior

screenshot from 2018-12-11 19-10-50

Expected behavior

screenshot from 2018-12-11 19-10-32

Relevant Zsh configuration (.zshrc)

SPACESHIP_PROMPT_ORDER=(dir kubecontext line_sep char)

Environment

Spaceship version: https://github.com/denysdovhan/spaceship-prompt/commit/4a7aaf8769e171909febbd52ae2938525cf808ae
Zsh version: 5.5.1
Zsh framework: None
Zsh plugin manager: None

Trace

+spaceship_kubecontext:15> local section_color i color pattern
+spaceship_kubecontext:16> local len=1
+spaceship_kubecontext:18> i = 1
+spaceship_kubecontext:18> i <= 1
+spaceship_kubecontext:19> color='()' 
+spaceship_kubecontext:20> pattern='' 
+spaceship_kubecontext:21> [[ "$kube_context" -regex-match "$pattern" ]]
+spaceship_kubecontext:22> section_color='()' 
+spaceship_kubecontext:23> break
+spaceship_kubecontext:27> [[ -z '()' ]]
+spaceship_kubecontext:29> spaceship::section '()' 'at ' '鈽革笍  spaceship-testing' ' '

Possible solution

  • Exit loop if length of array is 1, Since we require at least pair of values (color-pattern) to check for pattern.

// @maximbaz @nomaed

bug

All 3 comments

Why it wasn't checked before merging?

Had trouble setting up testing environment while doing review due to local issues. Identified this as soon as I was able to test it out locally.

It was tested, technically. At length even. But then different approaches were tried and it wasn't retested... Sorry, gonna submit a fix in a moment.

There's a weird thing now that SPACESHIP_KUBECONTEXT_SHOW is "false" even if I explicitly set it to "true" in my .zshrc... Trying to find where it can come from.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vburojevic picture vburojevic  路  3Comments

dguay picture dguay  路  4Comments

oldchevy picture oldchevy  路  3Comments

conradwt picture conradwt  路  3Comments

Vvkmnn picture Vvkmnn  路  3Comments