summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-10-26 19:52:08 +0200
committerMichael Adam <obnox@samba.org>2013-04-29 15:02:19 +0200
commit08d7caedf0f549d6ca61dc939d94fc267d7d54d4 (patch)
treeea83db275a0c3cb1e79d3aa80c157a5d12205ebe /source3/utils
parent92b6fc0edebe5df103c305f2d5226ba37ad632e4 (diff)
downloadsamba-08d7caedf0f549d6ca61dc939d94fc267d7d54d4.tar.gz
samba-08d7caedf0f549d6ca61dc939d94fc267d7d54d4.tar.bz2
samba-08d7caedf0f549d6ca61dc939d94fc267d7d54d4.zip
regedit: Use color only when available.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Apr 29 15:02:19 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/regedit.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source3/utils/regedit.c b/source3/utils/regedit.c
index 824bc3f86f..bd9765e5db 100644
--- a/source3/utils/regedit.c
+++ b/source3/utils/regedit.c
@@ -438,13 +438,20 @@ static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx)
{
struct regedit *regedit;
struct tree_node *root;
+ bool colors;
int key;
initscr();
- start_color();
+
cbreak();
noecho();
+ colors = has_colors();
+ if (colors) {
+ start_color();
+ use_default_colors();
+ }
+
regedit = talloc_zero(mem_ctx, struct regedit);
SMB_ASSERT(regedit != NULL);
regedit_main = regedit;