mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 01:48:47 +00:00
Force default colours if terminal supports it.
This commit is contained in:
parent
a3c89d7671
commit
dc8fb1e1dc
5
CHANGES
5
CHANGES
@ -1,5 +1,8 @@
|
|||||||
12 November 2007
|
12 November 2007
|
||||||
|
|
||||||
|
* (nicm) If the terminal supports default colours (AX present), force black
|
||||||
|
background and white foreground to default. This is useful on transparent
|
||||||
|
*terms for programs which don't do it themselves (like most(1)).
|
||||||
* (nicm) Fill in the rest of the man page.
|
* (nicm) Fill in the rest of the man page.
|
||||||
* (nicm) kill-session command.
|
* (nicm) kill-session command.
|
||||||
|
|
||||||
@ -203,4 +206,4 @@
|
|||||||
(including mutt, emacs). No status bar yet and no key remapping or other
|
(including mutt, emacs). No status bar yet and no key remapping or other
|
||||||
customisation.
|
customisation.
|
||||||
|
|
||||||
$Id: CHANGES,v 1.66 2007-11-12 16:09:08 nicm Exp $
|
$Id: CHANGES,v 1.67 2007-11-12 20:29:43 nicm Exp $
|
||||||
|
2
TODO
2
TODO
@ -51,6 +51,8 @@
|
|||||||
- per-session toolbar state, other options
|
- per-session toolbar state, other options
|
||||||
- commands:
|
- commands:
|
||||||
kill server
|
kill server
|
||||||
|
- force-default option: assume terminal supports default colours even if AX
|
||||||
|
is missing (like, eg, xterm-color in an aterm)
|
||||||
|
|
||||||
-- For 0.1 --------------------------------------------------------------------
|
-- For 0.1 --------------------------------------------------------------------
|
||||||
- fix most(1) problems after scrolling
|
- fix most(1) problems after scrolling
|
||||||
|
36
local.c
36
local.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: local.c,v 1.18 2007-11-08 10:39:52 nicm Exp $ */
|
/* $Id: local.c,v 1.19 2007-11-12 20:29:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -766,23 +766,33 @@ local_attributes(u_char attr, u_char colr)
|
|||||||
|
|
||||||
fg = (colr >> 4) & 0xf;
|
fg = (colr >> 4) & 0xf;
|
||||||
if (fg != ((local_colr >> 4) & 0xf)) {
|
if (fg != ((local_colr >> 4) & 0xf)) {
|
||||||
if (fg == 8) {
|
if (tigetflag("AX") == TRUE) {
|
||||||
if (tigetflag("AX") == TRUE)
|
if (fg == 7)
|
||||||
local_putp("\e[39m");
|
fg = 8;
|
||||||
else if (set_a_foreground != NULL)
|
} else {
|
||||||
local_putp(tparm(set_a_foreground, 7));
|
if (fg == 8)
|
||||||
} else if (set_a_foreground != NULL)
|
fg = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fg == 8)
|
||||||
|
local_putp("\e[39m");
|
||||||
|
else if (set_a_foreground != NULL)
|
||||||
local_putp(tparm(set_a_foreground, fg));
|
local_putp(tparm(set_a_foreground, fg));
|
||||||
}
|
}
|
||||||
|
|
||||||
bg = colr & 0xf;
|
bg = colr & 0xf;
|
||||||
if (bg != (local_colr & 0xf)) {
|
if (bg != (local_colr & 0xf)) {
|
||||||
if (bg == 8) {
|
if (tigetflag("AX") == TRUE) {
|
||||||
if (tigetflag("AX") == TRUE)
|
if (bg == 0)
|
||||||
local_putp("\e[49m");
|
bg = 8;
|
||||||
else if (set_a_background != NULL)
|
} else {
|
||||||
local_putp(tparm(set_a_background, 0));
|
if (bg == 8)
|
||||||
} else if (set_a_background != NULL)
|
bg = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bg == 8)
|
||||||
|
local_putp("\e[49m");
|
||||||
|
else if (set_a_background != NULL)
|
||||||
local_putp(tparm(set_a_background, bg));
|
local_putp(tparm(set_a_background, bg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user