-
Notifications
You must be signed in to change notification settings - Fork 661
Fedora: 08-shell-prompt.sh: line 10: patch: command not found #1086
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
Ironically the patch is not applied to Fedora anyway. It only applies to the Ubuntu (debian-based) prompt... It came from the old days, when the default.yaml was based on ubuntu.yaml and instances weren't renamed And it had some issues, like being totally illegible on a white background (since it was tested on a black one) One alternative is to remove the feature and use a more boring PS1, or write a more portable for the new color... |
Here is the discussion regarding the new color. It's an honored tradition, ever since the bikeshed. Compared with the ubuntu prompt. (with the "lime" color) The one in fedora is rather boring. (since it is monochrome) case $TERM in
xterm*|vte*)
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
else
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
fi
;;
screen*)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
fi
;;
*)
[ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
;;
esac
|
Colors aside, that script really should have looked for both # set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac It was supposed to do nothing ( |
Thanks for your words. 😄 I will consider this as a proper solution with a boring PS1, rather than bikesheding a more portable one for the new color. |
It was only supposed to patch the ubuntu-lima distribution: The goal was to make it different from the regular ubuntu: But it never made it to the alpine-lima distribution either: At least not by default, it is available in alpine if desired: And the truecolor (> 256) didn't take effect until a restart:
The real goal of the colors is to separate host, directory, and commands. "the focus in a terminal window should be on the output of commands, not on the prompt" A more "boring" PS1 could still have a way to indicate that it is a lima shell ? I think @AkihiroSuda was thinking of something like This is similar to the discussion about using a red root prompt (not just a Alpine opted to make a The hostname does have a "lima" in it already, so that is the hint otherwise... Stealing 7 characters of precious screen real estate might not be appreciated ? |
@afbjorklund The chosen patching approach is fragile and breaks all OS except Ubuntu, not just Fedora. To override the shell prompt in any OS it would be sufficient to append some snippet at the end of For the time being, would you accept a PR to skip this patching altogether if the OS isn't Ubuntu, until is has been decided how the Lima branding propagates to users' prompts? |
It was a nice hack at the time (well IMHO), but I'm fine with abandoning the Ubuntu patching for some other approach But tried to avoid the other systems here: Normally the fedora example was called "fedora", so there was no risk of breaking things when changing the "default" |
Description
limactl version 0.12.0
macOS 12.6
Fedora:
https://github.com/lima-vm/lima/blob/fc783ec455a91d70639f9a1d7f22e9890fe6b1cd/examples/fedora.yaml)
$ uname -a Linux lima-default 5.17.5-300.fc36.x86_64 #1 SMP PREEMPT Thu Apr 28 15:51:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
-1. If you came here for a solution
dnf install patch -y
.bashrc
to replace your current one0. systemd Failed Units: 1
$ lima [systemd] Failed Units: 1 cloud-final.service [vito@lima-default ~]$
1. patch: command not found
then I installed patch with
sudo dnf install patch
2. Hunk ... FAILED at ...
3. Check ~/.bashrc
4. Guess: you guys only made this for Ubuntu
Then I started an Ubuntu and copied the
.bashrc
to the Fedora..bashrc from Ubuntu
Problem solved.
The text was updated successfully, but these errors were encountered: