mirror of
https://github.com/starship/starship.git
synced 2024-12-29 10:38:52 +01:00
fe1a8df6fa
* refactor(bash): use `STARSHIP_*` for the internal variable names The current codebase uses `dbg_trap` to save the original DEBUG trap in bash <= 4.3. However, the variable name possibly conflicts a user variable since it is not prefixed by `_starship` or `starship_` or `STARSHIP_`. In this patch, we rename `dbg_trap` to `STARSHIP_DEBUG_TRAP` following other variables of `STARSHIP_EXIT_STATUS` and `STARSHIP_PIPE_STATUS`. We also rename the variable `_PRESERVED_PROMPT_COMMAND` to `STARSHIP_PROMPT_COMMAND`. * fix(bash): correctly extract DEBUG trap with spaces * fix(bash): evaluate DEBUG trap by eval The current code executes the saved DEBUG trap just by $_starship_dbg_trap. This causes various problems. The content of the variable `_starship_dbg_trap` is unexpectedly subject to the word splitting with the pathname expansions. Also, the needed shell expansions and quote removal are not performed. With a custom IFS, the content of the variable will be split in an unexpected way. The saved DEBUG trap needs to be executed by eval "$_starship_dbg_trap". |
||
---|---|---|
.. | ||
configs | ||
formatter | ||
init | ||
modules | ||
test | ||
bug_report.rs | ||
config.rs | ||
configure.rs | ||
context_env.rs | ||
context.rs | ||
lib.rs | ||
logger.rs | ||
main.rs | ||
module.rs | ||
print.rs | ||
segment.rs | ||
serde_utils.rs | ||
utils.rs |