From 08d7caedf0f549d6ca61dc939d94fc267d7d54d4 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 26 Oct 2012 19:52:08 +0200 Subject: regedit: Use color only when available. Signed-off-by: Andreas Schneider Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Mon Apr 29 15:02:19 CEST 2013 on sn-devel-104 --- source3/utils/regedit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3') 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; -- cgit