about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/config/preferences.c3
-rw-r--r--src/config/preferences.h3
-rw-r--r--src/profanity.c2
-rw-r--r--src/ui/core.c7
-rw-r--r--src/ui/ui.h1
-rw-r--r--tests/ui/stub_ui.c1
6 files changed, 15 insertions, 2 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c
index 22e80874..c1e76f4a 100644
--- a/src/config/preferences.c
+++ b/src/config/preferences.c
@@ -647,6 +647,8 @@ _get_key(preference_t pref)
             return "roster.resource";
         case PREF_ROSTER_BY:
             return "roster.by";
+        case PREF_EXIT_TITLE:
+            return "exit.title";
         default:
             return NULL;
     }
@@ -669,6 +671,7 @@ _get_default_boolean(preference_t pref)
         case PREF_MUC_PRIVILEGES:
         case PREF_PRESENCE:
         case PREF_WRAP:
+        case PREF_EXIT_TITLE:
             return TRUE;
         default:
             return FALSE;
diff --git a/src/config/preferences.h b/src/config/preferences.h
index c8b206ef..3302cca5 100644
--- a/src/config/preferences.h
+++ b/src/config/preferences.h
@@ -95,7 +95,8 @@ typedef enum {
     PREF_LOG_SHARED,
     PREF_OTR_LOG,
     PREF_OTR_WARN,
-    PREF_OTR_POLICY
+    PREF_OTR_POLICY,
+    PREF_EXIT_TITLE,
 } preference_t;
 
 typedef struct prof_alias_t {
diff --git a/src/profanity.c b/src/profanity.c
index e53ac176..c86a5475 100644
--- a/src/profanity.c
+++ b/src/profanity.c
@@ -290,7 +290,7 @@ _init(const int disable_tls, char *log_level)
 static void
 _shutdown(void)
 {
-    ui_clear_win_title();
+    ui_goodbye_title();
     ui_close_all_wins();
     jabber_disconnect();
     jabber_shutdown();
diff --git a/src/ui/core.c b/src/ui/core.c
index 2e8ae9ff..1c0089a1 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -2257,6 +2257,13 @@ ui_clear_win_title(void)
 }
 
 void
+ui_goodbye_title(void)
+{
+    int result = system("/bin/echo -ne \"\033]0;Thanks for using Profanity\007\"");
+    if(result == -1) log_error("Error printing title on shutdown");
+}
+
+void
 ui_statusbar_new(const int win)
 {
     status_bar_new(win);
diff --git a/src/ui/ui.h b/src/ui/ui.h
index e7b46766..4f78974c 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -190,6 +190,7 @@ void ui_handle_recipient_not_found(const char * const recipient, const char * co
 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);
+void ui_goodbye_title(void);
 void ui_handle_room_join_error(const char * const roomjid, const char * const err);
 void ui_handle_room_configuration(const char * const roomjid, DataForm *form);
 void ui_handle_room_configuration_form_error(const char * const roomjid, const char * const message);
diff --git a/tests/ui/stub_ui.c b/tests/ui/stub_ui.c
index 5361c08d..16fcdce7 100644
--- a/tests/ui/stub_ui.c
+++ b/tests/ui/stub_ui.c
@@ -266,6 +266,7 @@ void ui_handle_error(const char * const err_msg)
 }
 
 void ui_clear_win_title(void) {}
+void ui_goodbye_title(void) {}
 void ui_handle_room_join_error(const char * const roomjid, const char * const err) {}
 void ui_handle_room_configuration(const char * const roomjid, DataForm *form) {}
 void ui_handle_room_configuration_form_error(const char * const roomjid, const char * const message) {}