Comments (41)
from kube-ps1.
I basically tried the following 2 options:
export KUBE_PS1_CTX_COLOR="\[\033[0;35\]"
CTX_COLOR="$(echo -e '\033[0;35')"
from kube-ps1.
from kube-ps1.
I'm using bash
from kube-ps1.
This is actually an enhancement that I have to work on for bash. I am in the process of unifying the color handling so it will be the same for bash and zsh. I will label this as an enhancement for now.
This change should be in the next day or two as well.
Thanks again for making me aware of this issue and using kube-ps1.
from kube-ps1.
Thanks, looking forward to it.
from kube-ps1.
Try this new commit out and let me know if it does what you expect.
from kube-ps1.
I've just tried your new code but it seems to be behaving differently..
Without setting any colors explicitly by ENV variables, I'm getting the following prompt
(k8s|docker-for-desktop:default) » ~
instead of previously
(⎈ |docker-for-desktop:default) » ~
from kube-ps1.
from kube-ps1.
from kube-ps1.
Oh, sorry, was looking at this on my phone. What is your $LANG set to?
echo $LANG
from kube-ps1.
(k8s|docker-for-desktop:default) » ~ echo $LANG
en_US.UTF-8
from kube-ps1.
Check out the README as well, you can now specify color names as mentioned, and depending on your setup, the color code can be used as well.
from kube-ps1.
I've tried with one of the color names but the color remained the same..
But I'll try with the codes instead.
from kube-ps1.
Can you paste your config for kube-ps1 here? Bash version, etc as well.
from kube-ps1.
I suspect this is another bash < 4 issue. No echo -e, or printing with \u support, so I added hex codes for bash < 4. Try it out and let me know. If the colors are still and issue, the codes might need changed to.
from kube-ps1.
I actually have no specific config for kube-ps1, I only source your sh script and call the function in my prompt.
My bash version is as follows:
(k8s|docker-for-desktop:default) » ~ bash --version
GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.3.0)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
from kube-ps1.
from kube-ps1.
I replaced my kube-ps1.sh script with the new version but the result was unfortunately the same.
from kube-ps1.
Ok, well, we can try a couple more things. What does echo $KUBE_PS1_SHELL
return?
The only reason k8s
will appear is if it fails the shell check condition and doesn't print the symbols.
from kube-ps1.
(k8s|docker-for-desktop:default) » ~ echo $KUBE_PS1_SHELL
bash
It's strange because in the previous version of the code, the symbol would indeed print.
from kube-ps1.
That is strange. The only real difference is the usage of the actual symbol codes as opposed to putting the symbol itself in the script (this was done to support older versions of Bash).
Can you try to unset the KUBE_PS1_SYMBOL
, then start a new shell and source the script again ? Perhaps the variable is not being overwritten correctly?
from kube-ps1.
Something like this you mean ?
from kube-ps1.
I am having trouble reproducing this on MacOS with iTerm2:
from kube-ps1.
I've tried again with the script before I updated it with your changes regarding bash improvements.
The previous script seems to be working as expected.
But using the latest version seems to result in my errors.. Really strange...
from kube-ps1.
can you paste echo $PS1
from kube-ps1.
(k8s|docker-for-desktop:default) » ~ echo $PS1
$(kube_ps1) \[\033[0;32m\]\302\273\[\033[0m\] \[\033[0;34m\]\w\[\033[0m\]\[\033[0m\]
from kube-ps1.
This is a strange one indeed:
from kube-ps1.
Can you try to start bash without your configuration, and source kube-ps1?
bash --norc
source /path/to/kube-ps1.sh
PS1='$(kube_ps1) \[\033[0;32m\]\302\273\[\033[0m\] \[\033[0;34m\]\w\[\033[0m\]\[\033[0m\] '
from kube-ps1.
Also, another question. Can you show me the output of echo trying to print the character:
$ echo -e $'\u2388'
from kube-ps1.
from kube-ps1.
This is weird because the first line where the cluster context is in fact red, it's when sourcing the kube-ps1.sh without the latest changes to bash colors...
from kube-ps1.
What is the CTX color before and after:
echo $KUBE_PS1_CTX_COLOR
from kube-ps1.
Also, is there anything left over from your original question because you wanted it to be set to purple?
"I basically want to modify the context color from red to purple."
from kube-ps1.
I wanted to easily customise the colours, yes.
But that's not working at the moment... I'll try to reproduce this in a clean environment because I have a lot of stuff in my bash environment, this to see if something else is causing this...
The behaviour is not consistent across multiple laptops which also suggests that it may be something local to my setup...
from kube-ps1.
Ok, just making sure something isn't left over from it previously is all.
What did you get for the output of echo $KUBE_PS1_CTX_COLOR
?
from kube-ps1.
The output for that command is red
.
from kube-ps1.
Ok as it should be for the default, so its strange the purple color.
from kube-ps1.
Any luck?
from kube-ps1.
As a matter of fact, yes.
I started with a clean bash, and it seems to work fine with the latest version of the script.
So something must be messing it up with my current configuration.
I also noticed that the ENV variables need to be set before sourcing the script, which is obvious in retrospect...
I'll debug some more to find exactly what's causing the problem but the issue can be closed as far as I'm concerned.
Thanks for the help in debugging.
from kube-ps1.
No problem, thanks for using this project.
Also, the latest commit should fix the sourcing order problem for colors. Let me know.
from kube-ps1.
Related Issues (20)
- About `KUBE_PS1_SHELL` HOT 2
- Latest VScode 1.74 breaks kube-ps1: character not in range HOT 1
- kubeon/kubeoff does not change prompt when added as oh-my-zsh plugin HOT 10
- display context name HOT 2
- installing in Windows HOT 2
- Running kube_ps1 in bash function returns blank HOT 5
- A few questions about the documentation HOT 1
- multiple prompts HOT 7
- Hide no cluster and default namespace option HOT 2
- Dynamic context colors HOT 3
- Automatically disable kube-ps1 when no context is available HOT 2
- Support fish shell HOT 1
- Add support for Warp HOT 1
- Couldn't Show ☸️ in My Prompt HOT 2
- Ability to display kube-ps1 on the right side of the prompt HOT 1
- Character not in range HOT 2
- Don't work with spaceship theme HOT 3
- Would be great to have Nix Package for kube-ps1
- Multiple prompts if I source .zshrc HOT 2
- Keep kubeoff as default when opening new terminal HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-ps1.