-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 0ba77172a814fd61a5dfeca65acf67a33fd95387: path_to: revision_to:
commit 0ba77172a814fd61a5dfeca65acf67a33fd95387 Author: Marc Lehmann <schmorp@schmorp.de> Date: Fri Jan 6 02:58:02 2006 +0000 *** empty log message *** diff --git a/src/command.C b/src/command.C
--- a/src/command.C +++ b/src/command.C @@ -2720,10 +2720,10 @@ rxvt_term::cmd_parse () { seq_begin = cmdbuf_ptr; ch = next_char (); - } - if (ch == NOCHAR) // TODO: improve - break; + if (ch == NOCHAR) + break; + } if (!IS_CONTROL (ch) || ch == C0_LF || ch == C0_CR || ch == C0_HT) { diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
--- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -546,6 +546,36 @@ BOOT: sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); } +SV * +new (...) + CODE: +{ + stringvec *argv = new stringvec; + bool success; + + for (int i = 0; i < items ;i++) + argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); + + rxvt_term *term = new rxvt_term; + + term->argv = argv; + + try + { + if (!term->init (argv->size (), argv->begin ())) + term = 0; + } + catch (const class rxvt_failure_exception &e) + { + term->destroy (); + croak ("exception caught while initializing new terminal instance"); + } + + RETVAL = term && term->self ? newSVterm (term) : &PL_sv_undef; +} + OUTPUT: + RETVAL + void set_should_invoke (int htype, int value) CODE: @@ -618,6 +648,9 @@ SET_CUSTOM (int rend, int new_value) MODULE = urxvt PACKAGE = urxvt::term +void +rxvt_term::destroy () + int rxvt_term::strwidth (SV *str) CODE: @@ -979,6 +1012,25 @@ rxvt_term::tt_write (SV *octets) C_ARGS: str, len +void +rxvt_term::cmd_parse (SV *octets) + CODE: +{ + STRLEN len; + char *str = SvPVbyte (octets, len); + + char *old_cmdbuf_ptr = THIS->cmdbuf_ptr; + char *old_cmdbuf_endp = THIS->cmdbuf_endp; + + THIS->cmdbuf_ptr = str; + THIS->cmdbuf_endp = str + len; + + THIS->cmd_parse (); + + THIS->cmdbuf_ptr = old_cmdbuf_ptr; + THIS->cmdbuf_endp = old_cmdbuf_endp; +} + SV * rxvt_term::overlay (int x, int y, int w, int h, int rstyle = OVERLAY_RSTYLE, int border = 2) CODE: diff --git a/src/urxvt.pm b/src/urxvt.pm
--- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -139,7 +139,10 @@ When in doubt, return a false value (preferably C<()>). =item on_init $term Called after a new terminal object has been initialized, but before -windows are created or the command gets run. +windows are created or the command gets run. Most methods are unsafe to +call or deliver senseless data, as terminal size and other characteristics +have not yet been determined. You can safely query and change resources, +though. =item on_reset $term @@ -277,6 +280,14 @@ variable stores the current C<urxvt::term> object. =over 4 +=item $term = new urxvt [arg...] + +Creates a new terminal, very similar as if you had started it with +C<system $binfile, arg...>. Croaks (and probably outputs an error message) +if the new instance couldn't be created. Returns C<undef> if the new +instance didn't initialise perl, and the terminal object otherwise. The +C<init> and C<start> hooks will be called during the call. + =item urxvt::fatal $errormessage Fatally aborts execution with the given error message. Avoid at all @@ -503,6 +514,10 @@ sub urxvt::term::proxy::AUTOLOAD { =over 4 +=item $term->destroy + +Destroy the terminal object (close the window, free resources etc.). + =item $value = $term->resource ($name[, $newval]) Returns the current resource value associated with a given name and @@ -652,6 +667,12 @@ Normally its not a good idea to use this function, as programs might be confused by changes in cursor position or scrolling. Its useful inside a C<on_add_lines> hook, though. +=item $term->cmd_parse ($octets) + +Similar to C<scr_add_lines>, but the argument must be in the +locale-specific encoding of the terminal and can contain command sequences +(escape codes) that will be interpreted. + =item $term->tt_write ($octets) Write the octets given in C<$data> to the tty (i.e. as program input). To
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 10:14:24 2024