-
Notifications
You must be signed in to change notification settings - Fork 661
Make the shell prompt $PS1
distinguishable from the host shell
#427
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
Comments
I themed my login shell, so when I get default one I know it is another server 🙃 Both lima and docker (et al) do set the host name, but maybe a color clue could help |
Currently it is up to the Linux distribution, right ? |
Yes, the color should be probably lime 💚 (#268)
Yes |
For reference, the ubuntu prompt is:
It doesn't have any special 256-color prompt. For lima, that is the difference between "green" and "lime". https://en.wikipedia.org/wiki/Lime_(color) says It seems like color 154 would be the closest, in 256 colors ? echo -e "\\033[38;5;154mlima\\033[0m" See https://github.com/termstandard/colors for true color (888)
|
Here is one to try: GNOME (24-bit)
xterm-256color
xterm (16 colors)
monochrome
What they look like in Ubuntu: From default green, over to lime. |
I feel like this is an issue best left to the users themselves. It is no different than configuring a shell prompt on any of your other physical or virtual machines you connect to via And there are myriad ways to do this, including:
So any hardcoded mechanism is bound to not satisfy lots of users. I think it would be best to show some examples of setting this up in the FAQ, or in the sample config files, but leave the default prompt(s) to whatever the distro does. |
The suggestion was just to change from Ubuntu "green" to Lima "lime", for the default distribution. The feature to add Other distros (including ubuntu.yaml) would keep their default colors ? See systemd's https://www.freedesktop.org/software/systemd/man/os-release.html#ANSI_COLOR= (and their PS1) |
Replacing the default green with a lime shade is fine with me. But otherwise I'm going to stay out of this; I worry that this can turn into endless bike-shedding. |
BTW: For alpine, you need to source
Looks like for alpine-lima, it had been renamed to for script in /etc/profile.d/*.sh ; do
if [ -r $script ] ; then
. $script
fi
done |
I guess it is a bug in Alpine 3.13. In 3.14 it is called I have a slight preference to do it in |
You can probably leave it as-is, it's just a version difference: https://gitlab.alpinelinux.org/alpine/aports/-/issues/6933 It's rather ugly, so I don't think you want to enable it by default ? |
Feedback on the PR wonders if something should be done for monochrome terminals ? Like adding something to the beginning of the prompt, or whatever. Otherwise, it "works" There might be some usability issues with "light" theme instead of "dark" theme, here Tango: But I'm not sure if there is anything that can be done to detect that setting automatically ? Opting out of the (hardcoded) lime colors makes it legible, but the green and blue are better... Would be interesting to know how it works with macOS Terminal.app, I think that was light too ? |
I added some code (48db8c7), to only use the lima color when running with a dark theme: See github.com/afbjorklund/go-termbg/pkg/termbg for the detection, ported from a rust lib...
It works with most of the terminals. Unfortunately there are some Mac issues, needs darwin: |
Maybe we should change the color of
$PS1
by defaultThe text was updated successfully, but these errors were encountered: