diff --git a/.devcontainer/features/bash-config/config/bash-config-rc b/.devcontainer/features/bash-config/config/bash-config-rc index 2d3883e..5b8c2a5 100644 --- a/.devcontainer/features/bash-config/config/bash-config-rc +++ b/.devcontainer/features/bash-config/config/bash-config-rc @@ -36,6 +36,18 @@ __bash_prompt() { __bash_prompt export PROMPT_DIRTRIM=4 +# Set the default git editor if not already set +# from https://github.com/devcontainers/features/blob/f8e7e275b7ba2808e14a035afd753b83be68e2d9/src/common-utils/scripts/rc_snippet.sh +if [ -z "$(git config --get core.editor)" ] && [ -z "${GIT_EDITOR}" ]; then + if [ "${TERM_PROGRAM}" = "vscode" ]; then + if [[ -n $(command -v code-insiders) && -z $(command -v code) ]]; then + export GIT_EDITOR="code-insiders --wait" + else + export GIT_EDITOR="code --wait" + fi + fi +fi + # colorize ls output export LS_OPTIONS='--color=auto' eval "$(dircolors)" diff --git a/test/bash-config/test.sh b/test/bash-config/test.sh index a230aa1..029c3a6 100644 --- a/test/bash-config/test.sh +++ b/test/bash-config/test.sh @@ -10,6 +10,7 @@ source dev-container-features-test-lib # Feature-specific tests # The 'check' command comes from the dev-container-features-test-lib. Syntax is... # check