tree(1) colours not properly interpeted by watch(1) even with --color option
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I am using a simple combination of commands to "monitor" a bit of my filesystem change: watch and tree.
Except I want colours and can't get it.
Here's what I thought should work: watch --color 'tree -C'
which kind of works since it gives me some colours, but not in the same way as tree -C
by itself.
Here's some screencaps:
watch --color 'tree -C' output, with some colours applying
watch 'tree -C' output, showing that tree does indeed send all escape codes
tree -C output, expected result
Culprit might also be in my env variables, but if I watch 'echo $LS_COLORS'
, my conf is there.
Any ideas? :)
colors watch tree
add a comment |Â
up vote
1
down vote
favorite
I am using a simple combination of commands to "monitor" a bit of my filesystem change: watch and tree.
Except I want colours and can't get it.
Here's what I thought should work: watch --color 'tree -C'
which kind of works since it gives me some colours, but not in the same way as tree -C
by itself.
Here's some screencaps:
watch --color 'tree -C' output, with some colours applying
watch 'tree -C' output, showing that tree does indeed send all escape codes
tree -C output, expected result
Culprit might also be in my env variables, but if I watch 'echo $LS_COLORS'
, my conf is there.
Any ideas? :)
colors watch tree
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I am using a simple combination of commands to "monitor" a bit of my filesystem change: watch and tree.
Except I want colours and can't get it.
Here's what I thought should work: watch --color 'tree -C'
which kind of works since it gives me some colours, but not in the same way as tree -C
by itself.
Here's some screencaps:
watch --color 'tree -C' output, with some colours applying
watch 'tree -C' output, showing that tree does indeed send all escape codes
tree -C output, expected result
Culprit might also be in my env variables, but if I watch 'echo $LS_COLORS'
, my conf is there.
Any ideas? :)
colors watch tree
I am using a simple combination of commands to "monitor" a bit of my filesystem change: watch and tree.
Except I want colours and can't get it.
Here's what I thought should work: watch --color 'tree -C'
which kind of works since it gives me some colours, but not in the same way as tree -C
by itself.
Here's some screencaps:
watch --color 'tree -C' output, with some colours applying
watch 'tree -C' output, showing that tree does indeed send all escape codes
tree -C output, expected result
Culprit might also be in my env variables, but if I watch 'echo $LS_COLORS'
, my conf is there.
Any ideas? :)
colors watch tree
colors watch tree
asked Sep 13 at 19:49
Inva
82
82
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
The basic problem is that watch
and tree
use different information for getting the colors:
The
watch
program interprets standard (ECMA-48) escape sequences for specifying video attributes. That means 8 colors, plus bold, blink, underline, reverse and italics. It uses (n)curses to display the information, making the result depend on the terminal databaseThe
tree
program mimics GNUls
, using theLS_COLORS
environment variable. That uses theTERM
environment variable (which curses and most other terminal applications use to identify an entry in the terminal database) to select a set of customized escape sequences, which do not necessarily have any relationship to the terminal database's descriptions.
With some work, you could make those match, e.g., by generating a suitable LS_COLORS
for a given terminal entry. Apparently no one has done that. And since the contents of LS_COLORS
incomplete (covering only a small fraction of a terminal description: no function keys, no cursor movement, no generality), there is no point in generating a terminal entry from LS_COLORS
.
If tree
uses 256 colors, watch
may not understand those codes (a recent change addresses a part of this issue for procps top
but has not been adapted for watch
â wait a while). watch
uses (n)curses to manage the screen, which makes it necessary (for watch
) to translate escape-codes into curses-calls.
Further reading:
- How do I get color with VT100?
Applications miscited as library users- The Tree Command for Linux Homepage
- procps (watch development)
Makes sense! Thanks for the readings :)
â Inva
Sep 13 at 22:53
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The basic problem is that watch
and tree
use different information for getting the colors:
The
watch
program interprets standard (ECMA-48) escape sequences for specifying video attributes. That means 8 colors, plus bold, blink, underline, reverse and italics. It uses (n)curses to display the information, making the result depend on the terminal databaseThe
tree
program mimics GNUls
, using theLS_COLORS
environment variable. That uses theTERM
environment variable (which curses and most other terminal applications use to identify an entry in the terminal database) to select a set of customized escape sequences, which do not necessarily have any relationship to the terminal database's descriptions.
With some work, you could make those match, e.g., by generating a suitable LS_COLORS
for a given terminal entry. Apparently no one has done that. And since the contents of LS_COLORS
incomplete (covering only a small fraction of a terminal description: no function keys, no cursor movement, no generality), there is no point in generating a terminal entry from LS_COLORS
.
If tree
uses 256 colors, watch
may not understand those codes (a recent change addresses a part of this issue for procps top
but has not been adapted for watch
â wait a while). watch
uses (n)curses to manage the screen, which makes it necessary (for watch
) to translate escape-codes into curses-calls.
Further reading:
- How do I get color with VT100?
Applications miscited as library users- The Tree Command for Linux Homepage
- procps (watch development)
Makes sense! Thanks for the readings :)
â Inva
Sep 13 at 22:53
add a comment |Â
up vote
0
down vote
accepted
The basic problem is that watch
and tree
use different information for getting the colors:
The
watch
program interprets standard (ECMA-48) escape sequences for specifying video attributes. That means 8 colors, plus bold, blink, underline, reverse and italics. It uses (n)curses to display the information, making the result depend on the terminal databaseThe
tree
program mimics GNUls
, using theLS_COLORS
environment variable. That uses theTERM
environment variable (which curses and most other terminal applications use to identify an entry in the terminal database) to select a set of customized escape sequences, which do not necessarily have any relationship to the terminal database's descriptions.
With some work, you could make those match, e.g., by generating a suitable LS_COLORS
for a given terminal entry. Apparently no one has done that. And since the contents of LS_COLORS
incomplete (covering only a small fraction of a terminal description: no function keys, no cursor movement, no generality), there is no point in generating a terminal entry from LS_COLORS
.
If tree
uses 256 colors, watch
may not understand those codes (a recent change addresses a part of this issue for procps top
but has not been adapted for watch
â wait a while). watch
uses (n)curses to manage the screen, which makes it necessary (for watch
) to translate escape-codes into curses-calls.
Further reading:
- How do I get color with VT100?
Applications miscited as library users- The Tree Command for Linux Homepage
- procps (watch development)
Makes sense! Thanks for the readings :)
â Inva
Sep 13 at 22:53
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The basic problem is that watch
and tree
use different information for getting the colors:
The
watch
program interprets standard (ECMA-48) escape sequences for specifying video attributes. That means 8 colors, plus bold, blink, underline, reverse and italics. It uses (n)curses to display the information, making the result depend on the terminal databaseThe
tree
program mimics GNUls
, using theLS_COLORS
environment variable. That uses theTERM
environment variable (which curses and most other terminal applications use to identify an entry in the terminal database) to select a set of customized escape sequences, which do not necessarily have any relationship to the terminal database's descriptions.
With some work, you could make those match, e.g., by generating a suitable LS_COLORS
for a given terminal entry. Apparently no one has done that. And since the contents of LS_COLORS
incomplete (covering only a small fraction of a terminal description: no function keys, no cursor movement, no generality), there is no point in generating a terminal entry from LS_COLORS
.
If tree
uses 256 colors, watch
may not understand those codes (a recent change addresses a part of this issue for procps top
but has not been adapted for watch
â wait a while). watch
uses (n)curses to manage the screen, which makes it necessary (for watch
) to translate escape-codes into curses-calls.
Further reading:
- How do I get color with VT100?
Applications miscited as library users- The Tree Command for Linux Homepage
- procps (watch development)
The basic problem is that watch
and tree
use different information for getting the colors:
The
watch
program interprets standard (ECMA-48) escape sequences for specifying video attributes. That means 8 colors, plus bold, blink, underline, reverse and italics. It uses (n)curses to display the information, making the result depend on the terminal databaseThe
tree
program mimics GNUls
, using theLS_COLORS
environment variable. That uses theTERM
environment variable (which curses and most other terminal applications use to identify an entry in the terminal database) to select a set of customized escape sequences, which do not necessarily have any relationship to the terminal database's descriptions.
With some work, you could make those match, e.g., by generating a suitable LS_COLORS
for a given terminal entry. Apparently no one has done that. And since the contents of LS_COLORS
incomplete (covering only a small fraction of a terminal description: no function keys, no cursor movement, no generality), there is no point in generating a terminal entry from LS_COLORS
.
If tree
uses 256 colors, watch
may not understand those codes (a recent change addresses a part of this issue for procps top
but has not been adapted for watch
â wait a while). watch
uses (n)curses to manage the screen, which makes it necessary (for watch
) to translate escape-codes into curses-calls.
Further reading:
- How do I get color with VT100?
Applications miscited as library users- The Tree Command for Linux Homepage
- procps (watch development)
edited Sep 13 at 21:14
answered Sep 13 at 20:53
Thomas Dickey
50.3k587157
50.3k587157
Makes sense! Thanks for the readings :)
â Inva
Sep 13 at 22:53
add a comment |Â
Makes sense! Thanks for the readings :)
â Inva
Sep 13 at 22:53
Makes sense! Thanks for the readings :)
â Inva
Sep 13 at 22:53
Makes sense! Thanks for the readings :)
â Inva
Sep 13 at 22:53
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f468885%2ftree1-colours-not-properly-interpeted-by-watch1-even-with-color-option%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password