about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-04-03 21:13:59 +0100
committerJames Booth <boothj5@gmail.com>2014-04-03 21:13:59 +0100
commit95c081666adc44734f1fa5e1c50d52534325f522 (patch)
treedb25295f81f18eec0379072cfe8d2ac249d68f80
parente083e203136a71948a258c2c46cc5d5849ef944d (diff)
downloadprofani-tty-95c081666adc44734f1fa5e1c50d52534325f522.tar.gz
Clear window title bar on exit
-rw-r--r--src/profanity.c1
-rw-r--r--src/ui/core.c7
-rw-r--r--src/ui/ui.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/profanity.c b/src/profanity.c
index cc95875a..102d5160 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -313,6 +313,7 @@ _init(const int disable_tls, char *log_level)
 static void
 _shutdown(void)
 {
+    ui_clear_win_title();
     ui_close_all_wins();
     jabber_disconnect();
     jabber_shutdown();
diff --git a/src/ui/core.c b/src/ui/core.c
index c926d633..8ee83b90 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -1498,6 +1498,12 @@ _ui_chat_win_contact_offline(PContact contact, char *resource, char *status)
 }
 
 static void
+_ui_clear_win_title(void)
+{
+    printf("\033]0;\007");
+}
+
+static void
 _ui_draw_win_title(void)
 {
     char new_win_title[100];
@@ -1777,4 +1783,5 @@ ui_init_module(void)
     ui_handle_recipient_error = _ui_handle_recipient_error;
     ui_handle_error = _ui_handle_error;
     ui_current_update_virtual = _ui_current_update_virtual;
+    ui_clear_win_title = _ui_clear_win_title;
 }
diff --git a/src/ui/ui.h b/src/ui/ui.h
index 874ccee2..1dd6b160 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -132,6 +132,7 @@ void (*ui_chat_win_contact_offline)(PContact contact, char *resource, char *stat
 void (*ui_handle_recipient_not_found)(const char * const recipient, const char * const err_msg);
 void (*ui_handle_recipient_error)(const char * const recipient, const char * const err_msg);
 void (*ui_handle_error)(const char * const err_msg);
+void (*ui_clear_win_title)(void);
 
 // contact status functions
 void (*ui_status_room)(const char * const contact);