From 6889494869222520cc09121e8bb26159a76b0d0f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 5 Nov 2016 11:43:25 +0000 Subject: [PATCH] Emit an OSC 104 on quit to reset color palette on supporting terminals xterm and vte based terminals support it, unfortunately rxvt-unicode does not yet. Fixes #914 --- src/ncurses_ui.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc index efd078e5..e3c235ee 100644 --- a/src/ncurses_ui.cc +++ b/src/ncurses_ui.cc @@ -261,6 +261,11 @@ NCursesUI::NCursesUI() NCursesUI::~NCursesUI() { enable_mouse(false); + if (can_change_color()) // try to reset palette + { + fputs("\033]104;\007", stdout); + fflush(stdout); + } endwin(); set_signal_handler(SIGWINCH, SIG_DFL); set_signal_handler(SIGCONT, SIG_DFL);