File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
.devcontainer/features/bash-config/config Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,18 @@ __bash_prompt() {
36
36
__bash_prompt
37
37
export PROMPT_DIRTRIM=4
38
38
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
+
39
51
# enable bash completion for git
40
52
if [[ -f /usr/share/bash-completion/completions/git ]]; then
41
53
source /usr/share/bash-completion/completions/git
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ source dev-container-features-test-lib
11
11
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
12
12
# check <LABEL> <cmd> [args...]
13
13
check " execute command" bash -c " test $HISTFILE == $CONFIG_FOLDER /.bash_eternal_history"
14
+ check " execute command" bash -c " test $GIT_EDITOR == 'code --wait'"
14
15
15
16
# Report results
16
17
# 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