summaryrefslogtreecommitdiffstats
path: root/Src/prompt.c
Commit message (Collapse)AuthorAgeFilesLines
* unposted: silence compiler warning on new codeOliver Kiddle2025-11-171-2/+2
|
* 54074, 54082: add an opaque key for use in zle_highlight/region_highlight to ↵Oliver Kiddle2025-11-171-8/+149
| | | | allow mixing of colours
* 54075: allow highlighting to be reset in prompts using %H without following ↵Oliver Kiddle2025-11-171-4/+6
| | | | braces
* 54043, 54055: allow highlighing attributes to be turned back offOliver Kiddle2025-11-121-40/+102
|
* 54036: fixes related to prompt attribute leftoversOliver Kiddle2025-11-121-8/+0
|
* 53404: terminal integration with semantic markersOliver Kiddle2025-11-101-2/+7
|
* 53379, 53380: autoload nearcolor based on truecolor detectionOliver Kiddle2025-11-101-1/+17
|
* 53332, 53334: Avoid strlen calls after sprintfOliver Kiddle2025-01-301-22/+13
|
* 53257: use monotonic clock where appropriatedana2024-12-261-1/+1
| | | | | | | | | | | | | | | update the following features to use the monotonic clock for calculating time deltas and intervals: * MAILCHECK parameter * PERIOD parameter * SECONDS parameter * %(nS.t.f) prompt-expansion sequence * time built-in's elapsed time and cpu % values * zsh/zftp ZFTP_TMOUT parameter * zsh/zprof timings also use CLOCK_MONOTONIC_RAW instead of CLOCK_MONOTONIC on macOS
* 52646: extend support for highlight groups to completion explanation strings ↵Oliver Kiddle2024-03-051-3/+5
| | | | and WATCHFMT
* 52533: add module to provide alternate readonly views of the content of ↵Oliver Kiddle2024-02-151-0/+28
| | | | .zle.hlgroups
* 52517: ensure that %H is followed by {Mikael Magnusson2024-02-041-4/+6
| | | | | The previous code would accept any character after %H assuming it was a {, which was probably also a buffer overrun sometimes.
* 52516: fix crash in %H when hlgroups is emptyMikael Magnusson2024-02-041-1/+1
| | | | typeset -A .zle.hlgroups; print -P %H
* 52500: add layer token to zle attributesOliver Kiddle2024-01-281-2/+11
| | | | | This provide control over the precedence of highlighting where different regions overlap.
* 52499: support highlight groupsOliver Kiddle2024-01-281-2/+48
| | | | | These are defined in a .zle.hlgroups associative array and referenced using %H in prompt strings or hl= in zle_highlight/region_highlight.
* 51291: support for highlighting ellipses in the line editorOliver Kiddle2023-01-101-0/+3
|
* 51289: don't disable non-colour attributes in prompts for SINGLE_LINE_ZLE ↵Oliver Kiddle2023-01-101-2/+1
| | | | and remove superfluous extra escapes to disable attributes
* 51280: add support for italic and faint fonts in the line editorOliver Kiddle2023-01-101-2/+37
|
* 51258, 51272: refactor handling of terminal attributes, removing OFF flags ↵Oliver Kiddle2023-01-101-82/+172
| | | | in zattr
* 51212: remove STOUC() macroOliver Kiddle2022-12-161-1/+1
| | | | | This served as a workaround for ancient compilers where casts to unsigned char were broken.
* 50049: care with signed charactersPeter Stephenson2022-04-251-1/+1
| | | | | Some signed-to-unsigned casts needed for a couple of cases of pointers used as indices.
* security/41: Don't perform PROMPT_SUBST evaluation on %F/%K argumentsOliver Kiddle2022-02-121-0/+10
| | | | | | Mitigates CVE-2021-45444 (cherry picked from commit c187154f47697cdbf822c2f9d714d570ed4a0fd1)
* 49646: allow colors in WATCHFMT with %F/%KOliver Kiddle2021-12-131-4/+5
|
* 47510: drop code that avoided termcap for named coloursOliver Kiddle2021-04-031-36/+11
| | | | | | The inconsistency caused test failures where TERM is e.g. rxvt-unicode. This also makes a couple of bits available in zattr by removing flags indicating whether to use termcap which is not an attribute as such.
* 47352 (+ extra test cases): fix %<n>K prompt expansionStephane Chazelas2020-09-101-1/+1
| | | | | | | | | | | Fixed a regression introduced by workers/30496 (5.0.3) whereby %2K would no longer be the equivalent of %K{2} (%K{green}) in prompt expansion. That was one missing case where the is_fg flag was not passed along to match_colour() after code factorisation. Add tests for the different syntax variants, using echoti as a reference.
* 46068 (tweaked) (was: github #57): region_highlight: Add memo= support.Daniel Shahaf2020-06-251-3/+6
| | | | | | | | | | | | | | | | This is useful when multiple plugins add region_highlight entries and subsequently want to remove only their own entries. Without this functionality, recognizing one's region_highlight entries is not trivial because the 'start' and 'end' offsets are modified by editing of $BUFFER and the highlight specification may not be unique or distinctive. The tweaks are as follows: - Change zfree() to zsfree() per workers/46070. - Remove the mem.c hunk, as it changed the signature of only one out of two alternative definitions of zsfree(). (The definition that hunk touched is the one that's not used by default.)
* 45004: Fix typos in commentsMartijn Dekker2019-12-111-1/+1
|
* fix multiple bugs in countpromptromkatv2019-06-191-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | 1. Height off by one in the presence of meta characters at the end of the line. The following prompt has height 2 but countprompt used to return 3. PROMPT="${(pl.$COLUMNS..-.)}%f"$'\n' You can observe the effects of the bug with esc-x followed by reset-prompt. 2. Width off by one when a line is broken in the middle of a wide character. Assuming COLUMNS=79, the following prompt has width 2 but countprompt used to return 0. PROMPT="${(pl.40..\u3050.)}" zsh -df Press ctrl-r or type ls<tab> to observe the effects of the bug. 3. Width off by 1-7 when a line is broken in the middle of a tab. Assuming COLUMNS=79, the following prompt has width 1 but countprompt used to return 0. PROMPT="${(pl.10..\t.)}" zsh -df Press Ctrl-R or type ls<TAB> to observe the effects of the bug.
* 43288: fix line-broken promptsdana2019-04-181-3/+8
| | | | Without re-breaking the case where a newline character lands in column 0.
* 44030: prompt: Return error for unrecognised colour namedana2019-02-031-0/+2
|
* 44011: Only use fg_start_code for non-truecolorMikael Magnusson2019-01-231-10/+23
| | | | The sequence for truecolor uses a different prefix from palette colors
* users/23809: ZLE_HIGHLIGHT extensions.Peter Stephenson2018-12-301-4/+26
| | | | | Allow non-termcap use of colours > 7. Add tests.
* 43805: make nearcolor module use the default colour rather than black as a ↵Oliver Kiddle2018-11-081-1/+3
| | | | fallback
* 43804: also need to be able to turn colour attributes back into hex triples ↵Oliver Kiddle2018-11-081-4/+12
| | | | for region_highlight variable
* 43759: add support for true colour terminalsOliver Kiddle2018-11-051-44/+60
|
* 43747: new module to map colours from hex triplets to the nearest matching ↵Oliver Kiddle2018-11-051-1/+18
| | | | colour
* 43075: Support nanosecond-precision time formattingdana2018-06-201-5/+4
| | | | | | | | * Teach ztrftime() %9. and %N for nanoseconds * Update prompt expansion to pass sub-second times for time formatting * Update zsh/stat to pass sub-second times for atime/mtime/ctime Patch heavily based on Oliver's earlier work @ workers/24059
* 42285: off by one fix in multiple promptsWarepire2018-01-161-1/+1
|
* 42136: empty string check in %~ / %C prompt expansionsBarton E. Schaefer2018-01-141-1/+1
|
* 41078: Empty psvar could cause bad dereference in prompt expansionPeter Stephenson2017-05-091-1/+1
|
* 40260: zero new space allocated in prompt bufferPaulo Andrade2017-01-031-0/+1
|
* 39545: Add some missing unqueue_signals().Peter Stephenson2016-10-031-1/+3
| | | | All of these are added simply to fit existing logic in other branches.
* 38971: Start using the new arrlen_ge() / arrlen_le() helpers.Daniel Shahaf2016-08-011-3/+3
|
* 38809: fix tracking of colour attributes and restore them when turning bold offOliver Kiddle2016-07-081-4/+8
|
* 37868: add 'static' to file local variablesJun-ichi Takimoto2016-02-031-1/+1
|
* 36227: attempt to fix metafication problem with ztrftime.Peter Stephenson2015-08-181-3/+5
| | | | | fmt is treated as metafied on entry; use returned length to ensure we metafy or output the correct length if there are embedded nulls.
* Add non-metafied character length handling.Peter Stephenson2015-06-121-1/+1
| | | | | | | Use this in regex module and add test using $'\ua0'. Rename mb_metacharinit() to mb_charinit() as it does not involve metafied characters.
* 34322: bug with interface to parsestr() etc.Peter Stephenson2015-01-181-1/+1
| | | | | | | Was showing up in places like ${(e)...} where command substitution could reallocate the token string, but actually there was never any guarantee that the lexer wouldn't do that, so this was always a bit iffy.
* 33876: etc.: Separate errors and keyboards interruptsPeter Stephenson2014-12-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combination of 12 commits from interrupt_abort branch. Basic strategy is to introduce bits to errflag and to set and reset them separately. Remove interrupt status on return to main keymap. Turn off ERRFLAG_INT for always block. Restore bit thereafter: we probably need a new variable in order to allow user interrupts to be reset in the always block. Add TRY_BLOCK_INTERRUPT This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too. Ensure propagation of SIGINT from exited job. If received by foreground job, shell uses ERRFLAG_INT, not ERRFLAG_ERROR, to set the new state. Reset errflag before precmd() Add always block in _main_completion to fix ZLS_COLORS Ensures we get the right state of $ZLS_COLORS at the end of _main_complete even if there's an interrupt. However, the "right state" is a bit messy as it depends on styles.
* 33256: fix prompttrunc() counting of %{ %} spansBarton E. Schaefer2014-09-271-8/+6
|