--- rxvt-unicode/src/init.C 2006/01/06 05:28:55 1.133 +++ rxvt-unicode/src/init.C 2006/01/13 04:59:04 1.142 @@ -11,7 +11,7 @@ * - extensive modifications * Copyright (c) 1999 D J Hawkey Jr * - QNX support - * Copyright (c) 2003-2004 Marc Lehmann + * Copyright (c) 2003-2006 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -341,6 +341,7 @@ /* * Open display, get options/resources and create the window */ + if ((rs[Rs_display_name] = getenv ("DISPLAY")) == NULL) rs[Rs_display_name] = ":0"; @@ -350,6 +351,7 @@ rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); extract_resources (); + free (r_argv); /* @@ -393,7 +395,7 @@ /* no point having a scrollbar without having any scrollback! */ if (!saveLines) - CLR_OPTION (Opt_scrollBar); + set_option (Opt_scrollBar, 0); #ifdef PRINTPIPE if (!rs[Rs_print_pipe]) @@ -578,6 +580,8 @@ void rxvt_term::set_locale (const char *locale) { + set_environ (envv); + #if HAVE_XSETLOCALE || HAVE_SETLOCALE free (this->locale); this->locale = setlocale (LC_CTYPE, locale); @@ -586,13 +590,13 @@ { if (*locale) { - rxvt_warn ("unable to set locale \"%s\", using default locale instead.\n", locale); - setlocale (LC_CTYPE, ""); + rxvt_warn ("unable to set locale \"%s\", using C locale instead.\n", locale); + setlocale (LC_CTYPE, "C"); } else rxvt_warn ("default locale unavailable, check LC_* and LANG variables. Continuing.\n"); - this->locale = ""; + this->locale = "C"; } @@ -617,6 +621,8 @@ void rxvt_term::init_xlocale () { + set_environ (envv); + #ifdef USE_XIM if (!locale) rxvt_warn ("setting locale failed, working without locale support.\n"); @@ -918,7 +924,6 @@ MWMHints mwmhints; #endif XGCValues gcvalue; - long vt_emask; XSetWindowAttributes attributes; XWindowAttributes gattr; Window top, parent; @@ -1091,16 +1096,13 @@ vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask; - if (OPTION (Opt_pointerBlank) -#ifdef ENABLE_PERL - || self -#endif - ) + if (OPTION (Opt_pointerBlank)) vt_emask |= PointerMotionMask; else vt_emask |= Button1MotionMask | Button3MotionMask; - XSelectInput (disp, vt, vt_emask); + vt_select_input (); + vt_ev.start (display, vt); #if defined(MENUBAR) && (MENUBAR_MAX > 1) @@ -1582,7 +1584,7 @@ } else { - const char *argv0, *shell; + const char *argv0, *shell; if ((shell = getenv ("SHELL")) == NULL || *shell == '\0') shell = "/bin/sh"; @@ -1597,6 +1599,7 @@ strcpy (&login[1], argv0); argv0 = login; } + execlp (shell, argv0, NULL); /* no error message: STDERR is closed! */ }