--- rxvt-unicode/src/main.C 2006/01/11 19:55:34 1.173 +++ rxvt-unicode/src/main.C 2006/01/16 06:37:52 1.177 @@ -91,6 +91,14 @@ rxvt_set_locale (savelocale); } +void +rxvt_term::make_current () const +{ + SET_R (this); + rxvt_set_locale (locale); + set_environ (envv); +} + #if ENABLE_COMBINING class rxvt_composite_vec rxvt_composite; @@ -379,7 +387,7 @@ void rxvt_term::destroy_cb (time_watcher &w) { - SET_R (this); + make_current (); delete this; } @@ -480,9 +488,8 @@ rxvt_term::init (int argc, const char *const *argv) { SET_R (this); - TEMP_ENV; // few things in X do not call setlocale :( - set_locale (""); + set_environ (envv); // few things in X do not call setlocale :( if (!init_vars ()) return false; @@ -525,6 +532,7 @@ } #endif rxvt_perl.init (); + setlocale (LC_CTYPE, curlocale); // perl init destroys current locale HOOK_INVOKE ((this, HOOK_INIT, DT_END)); } #endif @@ -617,9 +625,13 @@ } } sig_handlers; +char **rxvt_environ; // startup environment + void rxvt_init () { + rxvt_environ = environ; + /* * Save and then give up any super-user privileges * If we need privileges in any area then we must specifically request it. @@ -1448,7 +1460,7 @@ char **s; XIMStyles *xim_styles; - TEMP_ENV; + set_environ (envv); if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) return false; @@ -1624,7 +1636,7 @@ char **s; char buf[IMBUFSIZ]; - SET_R (this); + make_current (); im_destroy ();