fix conf management
This commit is contained in:
@@ -94,8 +94,8 @@ A bar-style prompt showing current time, execution time of the last command
|
||||
| `busy` | fun | Monitor /dev/urandom for a hex pattern — look busy |
|
||||
| `check_updates` | updates | Check whether a newer profile version is available online; when called with `-q` at startup a 3-second network timeout is applied so a slow or absent network never delays the prompt |
|
||||
| `clean` | filefct | Erase backup files in given directories, optionally recursive |
|
||||
| `conf_dump` | conf | Display the profile configuration file; `-s/--section NAME` restricts output to one section; an optional pattern argument filters keys by substring match |
|
||||
| `conf_save` | conf | Save or update a key=value pair in a configuration section: `conf_save <section> <key> <value>`; creates the section header automatically if absent |
|
||||
| `conf_dump` | conf | Display the profile configuration file; `-s/--section NAME` restricts output to one section; `-a/--all` also lists commented-out keys (documented defaults, skipped when the key is set); an optional pattern argument filters keys by substring match; honours `NO_COLOR` |
|
||||
| `conf_save` | conf | Save or update a key=value pair in a configuration section: `conf_save <section> <key> <value>`; replaces an existing key in place or appends it to the section (creating the section if absent); works through a symlinked file and keeps its permissions; the value must be single-line and the running shell is not updated (applies at next load) |
|
||||
| `disp` | disp | Display formatted info / warning / error / debug messages; long messages are word-wrapped and continuation lines are indented to align with the message text |
|
||||
| `dwl` | net | Download a URL using curl, wget, or fetch transparently; supports `-t <seconds>` / `--timeout <seconds>` to cap the transfer time |
|
||||
| `expandlist` | filefct | Expand glob expressions into a quoted, separated list |
|
||||
@@ -188,21 +188,23 @@ automatically at startup:
|
||||
| *(absent or `smart`)* | Auto-detect the best available `terminfo` entry (default) |
|
||||
| any other string | Exported as-is — standard Unix behaviour |
|
||||
|
||||
When auto-detection runs, `COLORTERM=truecolor|24bit` is first evaluated as a
|
||||
global truecolor flag. Each emulator hint is then checked in order; within each
|
||||
branch a `*-direct` terminfo entry (24-bit colour) is tried before the
|
||||
`*-256color` fallback. Only entries confirmed to exist via `terminfo` are used.
|
||||
When auto-detection runs, `COLORTERM=truecolor|24bit` is evaluated as a global
|
||||
truecolor flag: it does not pick an entry by itself, it only enables the
|
||||
`*-direct` (24-bit colour) terminfo entries below, each of which falls back to its
|
||||
`*-256color` counterpart. Hints are checked in the following order and the first
|
||||
entry confirmed to exist via `terminfo` is used. Terminal multiplexers come first
|
||||
because they inherit the outer emulator's variables (`TERM_PROGRAM`,
|
||||
`VTE_VERSION`, …) but need their own `TERM`.
|
||||
|
||||
1. **`$COLORTERM`** — `truecolor` or `24bit` sets the truecolor flag for all subsequent probes
|
||||
2. **`$TERM_PROGRAM`** — emulator name hints:
|
||||
1. **`$TMUX`** — tmux session → `tmux-direct`¹ → `screen-direct`¹, then `tmux-256color`, then `screen-256color`
|
||||
2. **`$STY`** — GNU screen session → `screen-direct`¹, then `screen-256color`, then `screen`
|
||||
3. **`$TERM_PROGRAM`** — emulator name hints:
|
||||
- `iTerm.app` → `xterm-direct`¹, then `xterm-256color`
|
||||
- `WezTerm` → `xterm-direct`¹, then `wezterm`, then `xterm-256color`
|
||||
- `Hyper`, `vscode` → `xterm-direct`¹, then `xterm-256color`
|
||||
3. **`$VTE_VERSION`** — GNOME Terminal, Tilix, … → `vte-direct`¹, then `vte-256color`, then `xterm-256color`
|
||||
4. **`$WT_SESSION`** — Windows Terminal → `xterm-direct`¹, then `xterm-256color`
|
||||
5. **`$TMUX`** — tmux session → `tmux-direct`¹ → `screen-direct`¹, then `tmux-256color`, then `screen-256color`
|
||||
6. **`$STY`** — GNU screen session → `screen-direct`¹, then `screen-256color`, then `screen`
|
||||
7. **Generic probe** — `xterm-256color` → `xterm-color` → `xterm` → `vt100`
|
||||
4. **`$VTE_VERSION`** — GNOME Terminal, Tilix, … → `vte-direct`¹, then `vte-256color`, then `xterm-256color`
|
||||
5. **`$WT_SESSION`** — Windows Terminal → `xterm-direct`¹, then `xterm-256color`
|
||||
6. **Generic probe** — `xterm-256color` → `xterm-color` → `xterm` → `vt100`
|
||||
|
||||
¹ Only attempted when the truecolor flag is set (`COLORTERM=truecolor` or `24bit`).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user