Skip to content

Commit 4aca0e1

Browse files
committed
Change the default prompt color from green to lime
Signed-off-by: Anders F Björklund <[email protected]>
1 parent 67e465e commit 4aca0e1

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
set -eux
3+
4+
if [ "${LIMA_CIDATA_NAME}" = "default" ]; then
5+
6+
# Change the default shell prompt from "green" to "lime" (#BFFF00)
7+
8+
patch --forward -r - "/home/${LIMA_CIDATA_USER}.linux/.bashrc" <<'EOF'
9+
@@ -37,7 +37,11 @@
10+
11+
# set a fancy prompt (non-color, unless we know we "want" color)
12+
case "$TERM" in
13+
- xterm-color|*-256color) color_prompt=yes;;
14+
+ xterm-color) color_prompt=yes;;
15+
+ *-256color) color_prompt=256;;
16+
+esac
17+
+case "$COLORTERM" in
18+
+ truecolor) color_prompt=true;;
19+
esac
20+
21+
# uncomment for a colored prompt, if the terminal has the capability; turned
22+
@@ -56,8 +60,12 @@
23+
fi
24+
fi
25+
26+
-if [ "$color_prompt" = yes ]; then
27+
- PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
28+
+if [ "$color_prompt" = true ]; then
29+
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[38;2;192;255;0m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
30+
+elif [ "$color_prompt" = 256 ]; then
31+
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[38;5;154m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
32+
+elif [ "$color_prompt" = yes ]; then
33+
+ PS1='${debian_chroot:+($debian_chroot)}\[\033[01;92m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
34+
else
35+
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
36+
fi
37+
fi
38+
EOF
39+
40+
fi

pkg/cidata/cidata.TEMPLATE.d/lima.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
LIMA_CIDATA_NAME={{ .Name }}
12
LIMA_CIDATA_USER={{ .User }}
23
LIMA_CIDATA_UID={{ .UID }}
34
LIMA_CIDATA_MOUNTS={{ len .Mounts }}

0 commit comments

Comments
 (0)