prompt bug fix

This commit is contained in:
2026-10-13 14:35:00 +02:00
parent 9e96aaa411
commit afe1a1b610
5 changed files with 358 additions and 239 deletions
+14
View File
@@ -119,6 +119,20 @@ Versions follow `MAJOR.MINOR.PATCH-REVISION_STAGE_N` (e.g. `3.99.1-4_rc_1`).
child, validates the PID and refuses the current shell; `ppn` matched PIDs
and names such as `kde-bash` (now exact); `ppg`/`gpid` fallbacks no longer
match their own `awk`; `PPU_DEFAULT_FORMAT` documented with its real value.
- `prompt.sh` (security): a git branch, conda environment or virtualenv named
like `x$(command)` was **executed** each time the prompt was drawn, because the
names were copied into `PS1`; the context segment is now referenced as a
variable and never re-expanded.
- `prompt.sh`: the exit status shown in the prompt was always `0` (the nested
function definitions at the top of `set_prompt` reset `$?`; they are now
defined once at load time); `PROMPT_COLOR_*` overrides of the `[prompt]`
section never beat the theme and `$ColorName` values were emptied by
`parse_conf` in a fresh login shell (now resolved, validated, and re-applied
after `set_theme`); `set_theme --preview` left the previewed colours behind
when none were set before, and a switch to a partial theme kept the previous
theme's colours; the prompt no longer forks `date` twice per command
(`$EPOCHREALTIME`) and runs one `git status` instead of three git commands,
without taking the index lock.
- `compress.sh`: option flags and loop variables no longer leak into the
interactive shell.
+1 -1
View File
@@ -22,7 +22,7 @@ project and will not be addressed in Bash.
stops when the prompt reappears; in Windows Terminal, timer events appear tied to prompt
display rather than to the Enter keypress.
- **Cause:** Execution time is measured via a `DEBUG` trap and `PROMPT_COMMAND` using
`date +%s%N` deltas. WSL + Windows Terminal introduces scheduling jitter between Bash signal
`$EPOCHREALTIME` (or `date +%s%N` on bash < 5) deltas. WSL + Windows Terminal introduces scheduling jitter between Bash signal
events and the underlying Windows terminal layer that does not match wall-clock perception.
- **Impact:** Cosmetic / observability only — commands execute normally.
- **Status:** Not fixable in Bash; this is a limitation of the Windows Terminal / WSL