]> granicus.if.org Git - nethack/commitdiff
Unix CLI option to set windowtype
authorcohrs <cohrs>
Sun, 23 Nov 2003 21:36:36 +0000 (21:36 +0000)
committercohrs <cohrs>
Sun, 23 Nov 2003 21:36:36 +0000 (21:36 +0000)
Add the ability to select the windowtype on the command line on Unix using
a new -wwindowtype option.  I had thought the proposed patch could core
dump, but the default windowtype selection occurs earlier and ensures
that raw_print will always work.  So, the only problem with the proposed
patch was it didn't move the linux and sco special-case code until after
the selection was made.  That special-case code really should be moved to
to wintty.c, IMO since it doesn't affect other windowtypes.

doc/fixes35.0
sys/unix/unixmain.c

index eec9d25ddcb4da3f59b2b98e7ac5ab5c306582f7..14ba01d0ceccc52b9b61806c0e402e2b9469a736 100644 (file)
@@ -55,6 +55,7 @@ grammar fixes for applying stethoscope to corpses and statues
 
 Platform- and/or Interface-Specific Fixes
 -----------------------------------------
+unix: new -wwindowtype option
 win32gui: better handling of "more" prompt for messages that would have scrolled
        off the window
 win32gui: set correct checkmark on "Lock Windows" menu item on startup
index 8d269e9012f3c758bef1a306b633e84acc358503..7b577fb73af166d9e40ece88c577cfdecd4db7dd 100644 (file)
@@ -150,14 +150,7 @@ char *argv[];
        check_linux_console();
 #endif
        initoptions();
-       init_nhwindows(&argc,argv);
        exact_username = whoami();
-#ifdef _M_UNIX
-       init_sco_cons();
-#endif
-#ifdef __linux__
-       init_linux_cons();
-#endif
 
        /*
         * It seems you really want to play.
@@ -188,6 +181,13 @@ char *argv[];
 #endif
 
        process_options(argc, argv);    /* command line options */
+       init_nhwindows(&argc, argv);    /* now we can set up window system */
+#ifdef _M_UNIX
+       init_sco_cons();
+#endif
+#ifdef __linux__
+       init_linux_cons();
+#endif
 
 #ifdef DEF_PAGER
        if(!(catmore = nh_getenv("HACKPAGER")) && !(catmore = nh_getenv("PAGER")))
@@ -315,7 +315,6 @@ char *argv[];
 {
        int i;
 
-
        /*
         * Process options.
         */
@@ -404,6 +403,9 @@ char *argv[];
                                flags.initrace = i;
                        }
                        break;
+               case 'w': /* windowtype */
+                       choose_windows(&argv[0][2]);
+                       break;
                case '@':
                        flags.randomall = 1;
                        break;