Introduce the ability to control whether the shell run in pterm is a
[u/mdw/putty] / unix / pterm.c
index 58f9846..769f728 100644 (file)
@@ -1275,6 +1275,11 @@ void modalfatalbox(char *p, ...)
     exit(1);
 }
 
+char *get_x_display(void)
+{
+    return gdk_get_display();
+}
+
 int main(int argc, char **argv)
 {
     extern int pty_master_fd;         /* declared in pty.c */
@@ -1324,6 +1329,12 @@ int main(int argc, char **argv)
        if (!strcmp(p, "-hide")) {
            cfg.hide_mouseptr = 1;
        }
+       if (!strcmp(p, "-ut-")) {
+           cfg.stamp_utmp = 0;
+       }
+       if (!strcmp(p, "-ls-")) {
+           cfg.login_shell = 0;
+       }
        if (!strcmp(p, "-nethack")) {
            cfg.nethack_keypad = 1;
        }
@@ -1338,9 +1349,6 @@ int main(int argc, char **argv)
 
     init_ucs();
 
-    back = &pty_backend;
-    back->init(NULL, 0, NULL, 0);
-
     inst->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 
     if (cfg.wintitle[0])
@@ -1404,7 +1412,6 @@ int main(int argc, char **argv)
     gtk_signal_connect(GTK_OBJECT(inst->sbar_adjust), "value_changed",
                       GTK_SIGNAL_FUNC(scrollbar_moved), inst);
     gtk_timeout_add(20, timer_func, inst);
-    gdk_input_add(pty_master_fd, GDK_INPUT_READ, pty_input_func, inst);
     gtk_widget_add_events(GTK_WIDGET(inst->area),
                          GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK |
                          GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
@@ -1422,6 +1429,11 @@ int main(int argc, char **argv)
     inst->currcursor = inst->textcursor;
     show_mouseptr(1);
 
+    back = &pty_backend;
+    back->init(NULL, 0, NULL, 0);
+
+    gdk_input_add(pty_master_fd, GDK_INPUT_READ, pty_input_func, inst);
+
     term_init();
     term_size(24, 80, 2000);