--- rxvt-unicode/src/rxvtperl.xs 2021/05/08 06:16:21 1.248 +++ rxvt-unicode/src/rxvtperl.xs 2021/11/21 23:00:48 1.255 @@ -379,6 +379,7 @@ { if (perl) { + localise_env set_environ (perl_environ); perl_destruct (perl); perl_free (perl); PERL_SYS_TERM (); @@ -530,7 +531,7 @@ } bool -rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) +rxvt_perl_interp::invoke (rxvt_term *term, int htype, ...) { if (!perl || !term->perl.self) return false; @@ -822,6 +823,8 @@ const_iv (HOOK_INIT), const_iv (HOOK_DESTROY), const_iv (HOOK_ACTION), + const_iv (HOOK_OSC_SEQ), + const_iv (HOOK_OSC_SEQ_PERL), const_iv (NUM_RESOURCES), const_iv (DEFAULT_RSTYLE), @@ -1373,6 +1376,9 @@ rxvt_term::locale_encode (SV *str) CODE: { + if (!SvOK (str)) + XSRETURN_UNDEF; + wchar_t *wstr = sv2wcs (str); rxvt_push_locale (THIS->locale); @@ -1391,6 +1397,9 @@ rxvt_term::locale_decode (SV *octets) CODE: { + if (!SvOK (octets)) + XSRETURN_UNDEF; + STRLEN len; char *data = SvPVbyte (octets, len); @@ -1563,14 +1572,13 @@ RETVAL int -rxvt_term::view_start (int newval = 1) +rxvt_term::view_start (int newval = 0) PROTOTYPE: $;$ CODE: { RETVAL = THIS->view_start; - - if (newval <= 0) - THIS->scr_changeview (max (newval, THIS->top_row)); + if (items > 1) + THIS->scr_changeview (newval); } OUTPUT: RETVAL @@ -1790,7 +1798,7 @@ if (*s == NOCHAR) ; else if (IS_COMPOSE (*s)) - dlen += rxvt_composite.expand (*s, 0); + dlen += rxvt_composite.expand (*s); else dlen++;