Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Colors showing when TERM=dumb.
- X-seq: zsh-workers 30312
- From: John Gregorski <jfgorski@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Colors showing when TERM=dumb.
- Date: Sun, 4 Mar 2012 22:35:42 -0800
- Authentication-results: mr.google.com; spf=pass (google.com: domain of jfgorski@xxxxxxxxx designates 10.182.222.74 as permitted sender) smtp.mail=jfgorski@xxxxxxxxx; dkim=pass header.i=jfgorski@xxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=WNQk4zROD0sM7S8vbDwTZ0uzDO4yxzGZc6WLDW7kHno=; b=mJVKASX1b8poopaE7oPfxcxCVcGW1N2yGk4DmtZFWw2L78eHeIgnXq9Z7WC3GZVbpM K7lwBexYoLiwelhR78w3GDm3ZjwKbbTUGzGHqFxbb9tOFKrWrzVnAfCheltlVYn7EDQK 9qUiC1iuh5Ac5R7ifAexTD34vyzVNKVmksAcR5DSMySKyDwnu+A3DdrPlXzjs5bXOnCe /X4/PoJOIJSNSkBcp5cLtLI322iSsmaGyJAmpJtVKZ5xr9mw5KoS4JuB6C2sQB9d6T8e cfQXUFq02V/VBkpc2SZwAEdRig1F3X657FiZDNT4zQesSqQ+yt+4dv4vusrsBzqF0Xk7 raJA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
While playing around with my prompt I noticed that when TERM=dumb,
stuff like %B %U %S have no effect, but %F %K still print out terminal
escapes. Is this a bug? To work around it, I hacked putpromptchar in
prompt.c like this:
@@ -501,7 +501,7 @@
bv->fm--;
} else
arg = match_colour(NULL, 1, arg);
- if (arg >= 0 && !(arg & TXTNOFGCOLOUR)) {
+ if (arg >= 0 && !(arg & TXTNOFGCOLOUR) && tccan (TCFGCOLOUR)) {
txtchangeset(txtchangep, arg & TXT_ATTR_FG_ON_MASK,
TXTNOFGCOLOUR);
txtset(arg & TXT_ATTR_FG_ON_MASK);
@@ -510,9 +510,11 @@
}
/* else FALLTHROUGH */
case 'f':
+ if (tccan (TCFGCOLOUR)) {
txtchangeset(txtchangep, TXTNOFGCOLOUR, TXT_ATTR_FG_ON_MASK);
txtunset(TXT_ATTR_FG_ON_MASK);
set_colour_attribute(TXTNOFGCOLOUR, COL_SEQ_FG, TSC_PROMPT);
+ }
break;
case 'K':
if (bv->fm[1] == '{') {
@@ -522,7 +524,7 @@
bv->fm--;
} else
arg = match_colour(NULL, 0, arg);
- if (arg >= 0 && !(arg & TXTNOBGCOLOUR)) {
+ if (arg >= 0 && !(arg & TXTNOBGCOLOUR) && tccan (TCBGCOLOUR)) {
txtchangeset(txtchangep, arg & TXT_ATTR_BG_ON_MASK,
TXTNOBGCOLOUR);
txtset(arg & TXT_ATTR_BG_ON_MASK);
@@ -531,9 +533,11 @@
}
/* else FALLTHROUGH */
case 'k':
+ if (tccan (TCBGCOLOUR)) {
txtchangeset(txtchangep, TXTNOBGCOLOUR, TXT_ATTR_BG_ON_MASK);
txtunset(TXT_ATTR_BG_ON_MASK);
set_colour_attribute(TXTNOBGCOLOUR, COL_SEQ_BG, TSC_PROMPT);
+ }
break;
case '[':
if (idigit(*++bv->fm))
Messages sorted by:
Reverse Date,
Date,
Thread,
Author