Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions internal/devbox/shellrc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ ignore the existing value of HISTFILE.
HISTFILE="{{ .HistoryFile }}"
{{- end }}

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

{{- if .ShellStartTime }}
# log that the shell is ready now!
Expand Down
11 changes: 7 additions & 4 deletions internal/devbox/shellrc_fish.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ enough approximation for now.
set fish_history devbox
{{- end }}

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

{{- if .ShellStartTime }}
Expand Down
7 changes: 5 additions & 2 deletions internal/devbox/testdata/shellrc/basic/shellrc.golden
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ export simple="value";
export space="quote me";
export special="\$\`\"\\";

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

# End Devbox Post-init Hook

Expand Down
7 changes: 5 additions & 2 deletions internal/devbox/testdata/shellrc/noshellrc/shellrc.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@



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

# End Devbox Post-init Hook

Expand Down