diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 20:30:22 -0600 |
|---|---|---|
| committer | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-25 20:30:22 -0600 |
| commit | deb0ed011fe2cfc7058facb3f63b7feaeb8d4a8e (patch) | |
| tree | a05698851d28feb88d9bcf95a3530792b719b16b /web/layouts/partials/git@git.abendless.com:/srv/git | |
| parent | 456955dc33f24b1e9857bdc3c11788a2358e954c (diff) | |
| download | zash-deb0ed011fe2cfc7058facb3f63b7feaeb8d4a8e.tar.gz | |
interactive: a prompt's width counts columns, not bytes
The built-in editor skipped `ESC [ ...` sequences when working out where
the prompt ends. Colour and titles are not all CSI: an OSC title or
hyperlink runs to BEL or `ESC \`, DCS runs the same way, and `tput sgr0`
is the three-byte `ESC ( B` before `ESC [ m`. A prompt built with
`$(tput ...)` was measured wrong, which costs the cursor position and
with it the wrapped-line arithmetic.
`esc_seq_len()` in interact.c now walks what a terminal understands, and
edit_builtin.c uses it. The libedit build shares the walk: it brackets
control runs for `EL_PROMPT_ESC`, and adds the space libedit needs when
a prompt ends in one, since libedit attaches a literal run to the
character after it.
bench/editor.py measures the two costs run.sh cannot see, start to first
prompt and per-key echo, on a pty; bench/README.md has the table. The
release, z/OS and fuzz builds move to -O3 while the sanitizer and
coverage builds stay low: inlined frames make their reports harder to
read than the few percent they would gain.
Diffstat (limited to 'web/layouts/partials/git@git.abendless.com:/srv/git')
0 files changed, 0 insertions, 0 deletions
