diff mbox

menuconfig doesn't reset terminal colors correctly

Message ID 20160320123550.5331cfb6@frodo (mailing list archive)
State New, archived
Headers show

Commit Message

Richard Leitner March 20, 2016, 11:35 a.m. UTC
Hello,
I just noticed that "make menuconfig" doesn't reset the terminal colors correctly.
I'm running a XFCE Terminal with "xterm" emulation setting configured with black on white.
After "make menuconfig" exits all terminal output is white on black.

I've added fprintf's with the ANSI reset code for stdout and stderr to the mconf.c:handle_exit:



Basically this works for my tests, but I'm not sure if this is a desired solution...
Any comments? Should I prepare a patch for that or is this approach completely wrong?

thanks & regards,
Richard

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Richard Leitner March 28, 2016, 4:10 p.m. UTC | #1
Hi,
any updates on this?

On Sun, 20 Mar 2016 12:35:50 +0100
Richard Leitner <dev@g0hl1n.net> wrote:

> Hello,
> I just noticed that "make menuconfig" doesn't reset the terminal
> colors correctly. I'm running a XFCE Terminal with "xterm" emulation
> setting and configured with black on white. After "make menuconfig"
> exits all terminal output is white on black.
> 
> I've added fprintf's with the ANSI reset code for stdout and stderr
> to the mconf.c:handle_exit:
> 
> --- a/scripts/kconfig/mconf.c
> +++ b/scripts/kconfig/mconf.c
> @@ -969,6 +969,10 @@ static int handle_exit(void)
>  
>  	end_dialog(saved_x, saved_y);
>  
> +	/* reset terminal */
> +	fprintf(stdout, "\033[0m");
> +	fprintf(stderr, "\033[0m");
> +
>  	switch (res) {
>  	case 0:
>  		if (conf_write(filename)) {
> 
> 
> Basically this works for my tests, but I'm not sure if this is a
> desired solution... Any comments? Should I prepare a patch for that
> or is this approach completely wrong?
> 
> thanks & regards,
> Richard

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -969,6 +969,10 @@  static int handle_exit(void)
 
 	end_dialog(saved_x, saved_y);
 
+	/* reset terminal */
+	fprintf(stdout, "\033[0m");
+	fprintf(stderr, "\033[0m");
+
 	switch (res) {
 	case 0:
 		if (conf_write(filename)) {