File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
.devcontainer/features/bash-config/config Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,18 @@ __bash_prompt() {
3636__bash_prompt
3737export PROMPT_DIRTRIM=4
3838
39+ # Set the default git editor if not already set
40+ # from https://github.com/devcontainers/features/blob/f8e7e275b7ba2808e14a035afd753b83be68e2d9/src/common-utils/scripts/rc_snippet.sh
41+ if [ -z " $( git config --get core.editor) " ] && [ -z " ${GIT_EDITOR} " ]; then
42+ if [ " ${TERM_PROGRAM} " = " vscode" ]; then
43+ if [[ -n $( command -v code-insiders) && -z $( command -v code) ]]; then
44+ export GIT_EDITOR=" code-insiders --wait"
45+ else
46+ export GIT_EDITOR=" code --wait"
47+ fi
48+ fi
49+ fi
50+
3951# enable bash completion for git
4052if [[ -f /usr/share/bash-completion/completions/git ]]; then
4153 source /usr/share/bash-completion/completions/git
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ source dev-container-features-test-lib
1010# Feature-specific tests
1111# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
1212# check <LABEL> <cmd> [args...]
13- check " execute command" bash -c " test $HISTFILE == $CONFIG_FOLDER /.bash_eternal_history"
13+ check " eternal history" bash -c " test $HISTFILE == $CONFIG_FOLDER /.bash_eternal_history"
14+ check " git editor" TERM_PROGRAM=vscode bash -c " test \" $GIT_EDITOR \" == 'code --wait'"
1415
1516# Report results
1617# If any of the checks above exited with a non-zero exit code, the test will fail.
You can’t perform that action at this time.
0 commit comments