Close On Exit and Warn On Close fixes: (a) pty_reconfig needs to
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 12 Apr 2003 08:27:03 +0000 (08:27 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 12 Apr 2003 08:27:03 +0000 (08:27 +0000)
remember changes in COE so it knows whether to print a message, and
(b) once the session has already ended, Warn On Close should shut up.

git-svn-id: svn://svn.tartarus.org/sgt/putty@3102 cda61777-01e9-0310-a592-d414129be87e

unix/pterm.c
unix/pty.c

index d787da9..f2e8b12 100644 (file)
@@ -342,7 +342,7 @@ char *get_window_title(void *frontend, int icon)
 gint delete_window(GtkWidget *widget, GdkEvent *event, gpointer data)
 {
     struct gui_data *inst = (struct gui_data *)data;
-    if (inst->cfg.warn_on_close) {
+    if (!inst->exited && inst->cfg.warn_on_close) {
        if (!reallyclose(inst))
            return TRUE;
     }
index dac6736..5d85693 100644 (file)
@@ -623,21 +623,23 @@ static char *pty_init(void *frontend, void **backend_handle, Config *cfg,
     return NULL;
 }
 
-/*
- * Stub routine (we don't have any need to reconfigure this backend).
- */
 static void pty_reconfig(void *handle, Config *cfg)
 {
+    /*
+     * We don't have much need to reconfigure this backend, but
+     * unfortunately we do need to pick up the setting of Close On
+     * Exit so we know whether to give a `terminated' message.
+     */
+    pty_cfg = *cfg;                   /* structure copy */
 }
 
 /*
- * Stub routine (never called in pterm
+ * Stub routine (never called in pterm).
  */
 static void pty_free(void *handle)
 {
 }
 
-
 /*
  * Called to send data down the pty.
  */