1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-12 14:17:45 +00:00
starship/src
Koichi Murase fe1a8df6fa
fix(bash): fix handling of the preserved DEBUG trap (used in Bash <= 4.3) (#5908)
* 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".
2024-04-16 08:16:00 +02:00
..
configs feat(k8s): Add detect env vars option (#4488) 2024-04-06 15:30:19 +02:00
formatter chore: handle rust 1.72 clippy & fmt changes (#5399) 2023-08-25 22:53:35 +02:00
init fix(bash): fix handling of the preserved DEBUG trap (used in Bash <= 4.3) (#5908) 2024-04-16 08:16:00 +02:00
modules feat(k8s): Add detect env vars option (#4488) 2024-04-06 15:30:19 +02:00
test fix(status): fix pipestatus width calculation (#5036) 2024-03-20 22:58:33 +01:00
bug_report.rs fix: replace unmaintained crates yaml-rust, dirs-next (#5887) 2024-03-29 12:14:57 +01:00
config.rs chore: handle rust 1.72 clippy & fmt changes (#5399) 2023-08-25 22:53:35 +02:00
configure.rs build(deps): update toml crates (#5842) 2024-03-20 18:56:20 +09:00
context_env.rs chore: fix upcoming rust 1.77 clippy issues and chrono deprecations (#5850) 2024-03-20 18:57:14 +09:00
context.rs chore: fix upcoming rust 1.77 clippy issues and chrono deprecations (#5850) 2024-03-20 18:57:14 +09:00
lib.rs fix(config): Make print-config not panic without a config (#5001) 2023-04-13 19:29:21 -05:00
logger.rs fix: replace unmaintained crates yaml-rust, dirs-next (#5887) 2024-03-29 12:14:57 +01:00
main.rs chore: apply new rust 1.75 & nightly clippy fixes (#5646) 2023-12-30 17:29:37 +01:00
module.rs fix: combine ANSI color codes before wrapping them (#5762) 2024-04-06 15:28:26 +02:00
print.rs fix: combine ANSI color codes before wrapping them (#5762) 2024-04-06 15:28:26 +02:00
segment.rs refactor: replace ansi_term with nu_ansi_term (#4339) 2022-09-04 18:44:54 +02:00
serde_utils.rs build(deps): update toml crates (#4853) 2023-01-30 23:12:27 +01:00
utils.rs fix: combine ANSI color codes before wrapping them (#5762) 2024-04-06 15:28:26 +02:00