Skip to content

Commit b3c00b7

Browse files
committed
Option to disable modification of the user's prompt.
1 parent 525bb17 commit b3c00b7

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

internal/devbox/shellrc.tmpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ ignore the existing value of HISTFILE.
3838
HISTFILE="{{ .HistoryFile }}"
3939
{{- end }}
4040

41-
# Prepend to the prompt to make it clear we're in a devbox shell.
42-
export PS1="(devbox) $PS1"
41+
# If the user hasn't specified they want to handle the prompt themselves,
42+
# prepend to the prompt to make it clear we're in a devbox shell.
43+
if [ -z "$DEVBOX_NO_PROMPT" ]; then
44+
export PS1="(devbox) $PS1"
45+
fi
4346

4447
{{- if .ShellStartTime }}
4548
# log that the shell is ready now!

internal/devbox/shellrc_fish.tmpl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ enough approximation for now.
3838
set fish_history devbox
3939
{{- end }}
4040

41-
# Prepend to the prompt to make it clear we're in a devbox shell.
42-
functions -c fish_prompt __devbox_fish_prompt_orig
43-
function fish_prompt
44-
echo "(devbox)" (__devbox_fish_prompt_orig)
41+
# If the user hasn't specified they want to handle the prompt themselves,
42+
# prepend to the prompt to make it clear we're in a devbox shell.
43+
if not set -q devbox_no_prompt
44+
functions -c fish_prompt __devbox_fish_prompt_orig
45+
function fish_prompt
46+
echo "(devbox)" (__devbox_fish_prompt_orig)
47+
end
4548
end
4649

4750
{{- if .ShellStartTime }}

0 commit comments

Comments
 (0)