Files
ghostty/src
Jon Parise 23f3cd5f10 zsh: improve prompt marking with dynamic themes
Replace the strip-in-preexec / re-add-in-precmd pattern for OSC 133
marks with a save/restore approach. Instead of pattern-matching marks
out of PS1 (which exposes PS1 in intermediate states to other hooks), we
save the original PS1/PS2 before adding marks and then restore them.

This also adds dynamic theme detection: if PS1 changed between cycles
(e.g., a theme rebuilt it), we skip injecting continuation marks into
newlines. This prevents breaking plugins like Pure that use pattern
matching to strip/rebuild the prompt.

Additionally, move _ghostty_precmd to the end of precmd_functions in
_ghostty_deferred_init (instead of substituting in-place) so that the
first prompt is properly marked even when other hooks were appended
after our auto-injection.

There's one scenario that we still don't complete cover:

    precmd_functions+=(_test_overwrite_ps1)
    _test_overwrite_ps1() {
        PS1="test> "
    }

... which results in the first prompt not printing its prompt marks
because _test_overwrite_ps1 becomes the last thing to run, overwriting
our marks, but this will be fixed for subsequent prompts when we move
our handler back to the last index.

Fixes: #11282
2026-03-11 10:07:54 -04:00
..
2025-10-03 07:10:43 -07:00
2026-03-08 07:16:14 +00:00
2025-11-27 13:37:53 -08:00
2025-10-03 18:52:26 +02:00
2026-02-01 14:32:37 -08:00
2025-11-27 13:37:53 -08:00
2025-11-27 13:37:53 -08:00
2025-10-03 07:10:43 -07:00
2026-01-08 10:22:56 -08:00
2026-03-01 14:55:07 -08:00
2025-11-27 13:37:53 -08:00
2025-11-27 13:37:53 -08:00
2024-08-16 14:35:10 -07:00
2025-07-09 15:06:24 -07:00
2022-08-18 11:42:32 -07:00
2025-10-03 07:10:43 -07:00
2025-11-27 13:37:53 -08:00