Use #-# style comments

This commit is contained in:
cubernetes 2026-10-15 10:49:38 +02:00
parent 82c0cd1d93
commit 728a5f14b5

View file

@ -165,13 +165,13 @@ bashrc_forward () {
'
}
# HARD TO FIX BUG: shopt -u expand_aliases must be run in ENV so bash-abbr works, but ENV is run before the shell switches to interactive
# use, and --rcfile is run after. We need to disable expand_aliases AFTER the shell switches to interactive mode, because on that switch
# alias expansion is always turned on. You'd think you could use a trap, PROMPT_COMMAND, or bind -x trick for that, but no, there's a bug
# currently in bash that prevents exactly that. The only workaround at the moment is to create a custom binding that injects the
# shopt -u expand_aliases command ONCE before the very first command.
# When bash finally fixes that trap bug, then we don't need to do that anymore. Reproducer for the bug (run from another bash shell):
# env -i bash --noprofile --rcfile <(echo 'alias foo="echo EXPANDED"; trap "shopt -u expand_aliases; trap - DEBUG" DEBUG') -ic $'shopt expand_aliases\nfoo\nshopt -u expand_aliases\nfoo'
#-# HARD TO FIX BUG: shopt -u expand_aliases must be run in ENV so bash-abbr works, but ENV is run before the shell switches to interactive
#-# use, and --rcfile is run after. We need to disable expand_aliases AFTER the shell switches to interactive mode, because on that switch
#-# alias expansion is always turned on. You'd think you could use a trap, PROMPT_COMMAND, or bind -x trick for that, but no, there's a bug
#-# currently in bash that prevents exactly that. The only workaround at the moment is to create a custom binding that injects the
#-# shopt -u expand_aliases command ONCE before the very first command.
#-# When bash finally fixes that trap bug, then we don't need to do that anymore. Reproducer for the bug (run from another bash shell):
#-# env -i bash --noprofile --rcfile <(echo 'alias foo="echo EXPANDED"; trap "shopt -u expand_aliases; trap - DEBUG" DEBUG') -ic $'shopt expand_aliases\nfoo\nshopt -u expand_aliases\nfoo'
#-# Special aliases that play nicely with my `bash-abbr` bash plugin. The leading `*` means they expand
#-# anywhere in the command line (as long as they start a word). Like global aliases in zsh.