Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] prompt, etc: trust when termcap says we have no colour
- X-seq: zsh-workers 54386
- From: dana <dana@xxxxxxx>
- To: "Oliver Kiddle" <opk@xxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] prompt, etc: trust when termcap says we have no colour
- Date: Wed, 22 Apr 2026 21:37:26 -0500
- Archived-at: <https://zsh.org/workers/54386>
- Feedback-id: i9be146f9:Fastmail
- In-reply-to: <35831-1776906408.734956@X0gm.2xts.6Xm->
- List-id: <zsh-workers.zsh.org>
- References: <10895965-af97-4800-ba2e-cf65b9b6e25f@app.fastmail.com> <35831-1776906408.734956@X0gm.2xts.6Xm->
On Wed 22 Apr 2026, at 20:06, Oliver Kiddle wrote:
> However, I don't follow the logic behind using this as a heuristic for
> italic and faint. Heuristics should at least be based on some lived
> examples. And `TERM=dumb tput sitm` produces nothing so what problem are
> you solving?
well, it wouldn't, because tput doesn't fall back to a hard-coded \e[3m
when it's not in the db like zsh does
the problem i was trying to solve, or at least minimise, is that we may
emit sequences for italics on terminals that don't support them
maybe the most likely example of this is the linux console (TERM=linux)
-- if i set zle_highlight=( default:italic ) there, all my inputs are
green
as far as the heuristic, i just figured 'has colours' would be a high
enough bar that it'll avoid that issue for more limited terminals
without leaving us without the polyfills for... whichever terminals you
added those for (?)
unfortunately it won't do anything for TERM=linux specifically. but
since we've already decided to not trust what termcap says about this
capability idk what would be a more reliable method. do you?
ps: TERM=dumb is actually not affected by this issue because it has
TERM_NOUP, which makes tsetcap() a no-op. TERM=sun and TERM=vt100 are
examples of ones that are, and are 'fixed' by my heuristic
dana
Messages sorted by:
Reverse Date,
Date,
Thread,
Author