repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 2faa5cf161ae1b074501737879c4d77e819f2668: path_to: revision_to:
commit 2faa5cf161ae1b074501737879c4d77e819f2668 Author: Marc LehmannDate: Thu Jul 7 19:37:47 2005 +0000 *** empty log message *** diff --git a/Changes b/Changes
--- a/Changes
+++ b/Changes
@@ -1,3 +1,4 @@
+TODO: Make change? [y... flood freezes until outputter is being killed
TODO: do font request caching, might help rxvtd on some machines
TODO: safer command: keymap processing.
TODO: "slow" rendering mode for bidi and scripts
@@ -11,6 +12,9 @@ WISH: OnTheSpot editing, or maybe switch to miiiiiiif
WISH: tabbed windows (hey, just use screen...)
WISH: just for fun, do shade and tint with XRender.
+ - implement some useful (hopefully) options for rxvtd.
+ - seperate and improved rxvtc(1) and rxvtd(1) manpages.
+
5.6 Sun Jun 26 22:11:13 CEST 2005
- R_SB_RXVT bitset value was 0, so rxvt scrollbar was initialised
every time resulting in display errors (original rxvt also affected).
diff --git a/MANIFEST b/MANIFEST
--- a/MANIFEST +++ b/MANIFEST @@ -32,13 +32,20 @@ doc/changes.txt doc/podtbl doc/rxvt.1.pod doc/rxvt.7.pod +doc/rxvtc.1.pod +doc/rxvtd.1.pod doc/rxvt.1.man.in doc/rxvt.7.man.in +doc/rxvtc.1.man.in +doc/rxvtd.1.man.in doc/rxvt.1.html doc/rxvt.7.html +doc/rxvtc.1.html +doc/rxvtd.1.html doc/rxvt.1.txt doc/rxvt.7.txt -doc/rxvtc.1 +doc/rxvtc.1.txt +doc/rxvtd.1.txt doc/rxvt-unicode.spec autoconf/.cvsignore diff --git a/doc/Makefile.in b/doc/Makefile.in
--- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -42,14 +42,21 @@ SEDREPLACE = -e 's%@@RXVT_VERSION@@%$(VERSION)%g;'\ tags allbin: -alldoc: rxvt.1.man.in rxvt.7.man.in rxvt.1.html rxvt.7.html rxvt.1.txt rxvt.7.txt ../README.configure ../README.FAQ +alldoc: rxvt.1.man.in rxvt.7.man.in rxvtc.1.man.in rxvtd.1.man.in \ + rxvt.1.txt rxvt.7.txt rxvtc.1.txt rxvtd.1.txt \ + rxvt.1.html rxvt.7.html rxvtc.1.html rxvtd.1.html \ + ../README.configure ../README.FAQ infocmp -C rxvt-unicode >etc/rxvt-unicode.termcap clean: $(RMF) *~ realclean: clean - $(RMF) tags rxvt.1.man.in rxvt.7.man.in rxvt.1.html rxvt.7.html rxvt.1.txt rxvt.7.txt ../README.configure ../README.FAQ + $(RMF) tags ../README.configure ../README.FAQ + $(RMF) rxvt.1.man.in rxvt.7.man.in rxvtc.1.man.in rxvtd.1.man.in + $(RMF) rxvt.1.man rxvt.7.man rxvtc.1.man rxvtd.1.man + $(RMF) rxvt.1.txt rxvt.7.txt rxvtc.1.txt rxvtd.1.txt + $(RMF) rxvt.1.html rxvt.7.html rxvtc.1.html rxvtd.1.html cleandir: realclean @@ -62,8 +69,10 @@ install: $(INSTALL_DATA) rxvt.1.man $(DESTDIR)$(man1dir)/$(RXVTNAME).$(man1ext) $(SED) $(SEDREPLACE) < rxvt.7.man.in >rxvt.7.man $(INSTALL_DATA) rxvt.7.man $(DESTDIR)$(man7dir)/$(RXVTNAME).$(man7ext) - $(INSTALL_DATA) rxvtc.1 $(DESTDIR)$(man1dir)/$(RXVTNAME)c.$(man1ext) - $(INSTALL_DATA) rxvtc.1 $(DESTDIR)$(man1dir)/$(RXVTNAME)d.$(man1ext) + $(SED) $(SEDREPLACE) < rxvtc.1.man.in >rxvtc.1.man + $(INSTALL_DATA) rxvtc.1.man $(DESTDIR)$(man1dir)/$(RXVTNAME)c.$(man1ext) + $(SED) $(SEDREPLACE) < rxvtd.1.man.in >rxvtd.1.man + $(INSTALL_DATA) rxvtd.1.man $(DESTDIR)$(man1dir)/$(RXVTNAME)d.$(man1ext) if test -x "@TIC@"; then if test -n "@TIC@"; then @TIC@ etc/rxvt-unicode.terminfo; fi; fi uninstall: diff --git a/doc/rxvt-tabbed b/doc/rxvt-tabbed
--- a/doc/rxvt-tabbed +++ b/doc/rxvt-tabbed @@ -1,6 +1,6 @@ #!/usr/bin/perl -# I tried to write this with Tk, as it uses elss memory and is +# I tried to write this with Tk, as it uses less memory and is # more widely available. Alas, Tk is rather broken with respect to embedding. # on debian, do: diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html
--- a/doc/rxvt.1.html +++ b/doc/rxvt.1.html @@ -49,7 +49,7 @@
DESCRIPTION
-rxvt-unicode, version 5.5, is a colour vt102 terminal +
rxvt-unicode, version 5.6, is a colour vt102 terminal emulator intended as an xterm(1) replacement for users who do not require features such as Tektronix 4014 emulation and toolkit-style configurability. As a result, rxvt-unicode uses much less swap space -- @@ -950,6 +950,20 @@ Specify a command pipe for vt100 printer [default lpr(1)]. Use Print to initiate a screen dump to the printer and Ctrl-Print or Shift-Print to include the scrollback as well. +
The string will be interpreted as if typed into the shell as-is.
+Example:
++ URxvt*print-pipe: cat > $(TMPDIR=$HOME mktemp urxvt.XXXXXX)+
This creates a new file in your home directory with the screen contents
+everytime you hit Print.
rxvtc(1) and
rxvtd(1).
Default $HOME/.rxvt-unicode-<nodename.
Default $HOME/.rxvt-unicode-<nodename >>>.
@@ -1622,7 +1636,7 @@ Color names.
SEE ALSO
-rxvt(7), xterm(1), sh(1), resize(1), X(1), pty(4), tty(4), utmp(5)
rxvt(7), rxvtc(1), rxvtd(1), xterm(1), sh(1), resize(1), X(1), pty(4), tty(4), utmp(5)
diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in
--- a/doc/rxvt.1.man.in +++ b/doc/rxvt.1.man.in @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "rxvt 1" -.TH rxvt 1 "2005-06-18" "5.5" "RXVT-UNICODE" +.TH rxvt 1 "2005-07-07" "5.6" "RXVT-UNICODE" .SH "NAME" rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system) .SH "SYNOPSIS" @@ -760,6 +760,17 @@ option \fB\-ut\fR. \fBFalse\fR: write record into the system log file \fButmp\fR Specify a command pipe for vt100 printer [default \fI\fIlpr\fI\|(1)\fR]. Use \&\fBPrint\fR to initiate a screen dump to the printer and \fBCtrl-Print\fR or \&\fBShift-Print\fR to include the scrollback as well. +.Sp +The string will be interpreted as if typed into the shell as\-is. +.Sp +Example: +.Sp +.Vb 1 +\& URxvt*print-pipe: cat > $(TMPDIR=$HOME mktemp urxvt.XXXXXX) +.Ve +.Sp +This creates a new file in your home directory with the screen contents +everytime you hit \f(CW\*(C`Print\*(C'\fR. .IP "\fBscrollBar:\fR \fIboolean\fR" 4 .IX Item "scrollBar: boolean" \&\fBTrue\fR: enable the scrollbar [default]; option \fB\-sb\fR. \fBFalse\fR: @@ -1226,7 +1237,7 @@ Used in the same way as \f(CW\*(C`RXVTPATH\*(C'\fR. The unix domain socket path used by @@RXVT_NAME@@c(1) and @@RXVT_NAME@@d(1). .Sp -Default \f(CW\*(C`$HOME/.rxvt\-unicode\- --- a/doc/rxvt.1.pod +++ b/doc/rxvt.1.pod @@ -1249,7 +1249,7 @@ Used in the same way as C. The unix domain socket path used by @@RXVT_NAME@@c(1) and @@RXVT_NAME@@d(1). -Default C<< $HOME/.rxvt-unicode- >. +Default F<<< $HOME/.rxvt-unicode-I<< > >>>. =item B @@ -1280,7 +1280,7 @@ Color names. =head1 SEE ALSO -@@RXVT_NAME@@(7), xterm(1), sh(1), resize(1), X(1), pty(4), tty(4), utmp(5) +@@RXVT_NAME@@(7), @@RXVT_NAME@@c(1), @@RXVT_NAME@@d(1), xterm(1), sh(1), resize(1), X(1), pty(4), tty(4), utmp(5) =head1 BUGS diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt --- a/doc/rxvt.1.txt +++ b/doc/rxvt.1.txt @@ -6,7 +6,7 @@ SYNOPSIS rxvt [options] [-e command [ args ]] DESCRIPTION - rxvt-unicode, version 5.5, is a colour vt102 terminal emulator intended + rxvt-unicode, version 5.6, is a colour vt102 terminal emulator intended as an *xterm*(1) replacement for users who do not require features such as Tektronix 4014 emulation and toolkit-style configurability. As a result, rxvt-unicode uses much less swap space -- a significant @@ -614,6 +614,15 @@ RESOURCES (available also as long-options) Print to initiate a screen dump to the printer and Ctrl-Print or Shift-Print to include the scrollback as well. + The string will be interpreted as if typed into the shell as-is. + + Example: + + URxvt*print-pipe: cat > $(TMPDIR=$HOME mktemp urxvt.XXXXXX) + + This creates a new file in your home directory with the screen + contents everytime you hit "Print". + scrollBar: *boolean* True: enable the scrollbar [default]; option -sb. False: disable the scrollbar; option +sb. @@ -1064,7 +1073,7 @@ ENVIRONMENT RXVT_SOCKET The unix domain socket path used by rxvtc(1) and rxvtd(1). - Default "$HOME/.rxvt-unicode-[same options as for @@RXVT_NAME@@] + +=head1 DESCRIPTION + +This manpage describes the B<@@RXVT_NAME@@c> client program. It connects +to the B<@@RXVT_NAME@@d> daemon and requests a new terminal window. It +takes the same arguments as the B<@@RXVT_NAME@@> program. The environment +will also be respected. Currently, it always returns immediately after +contacting the daemon. + +=head1 OPTIONS + +All options that are valid for B<@@RXVT_NAME@@> are valid for +B<@@RXVT_NAME@@c>, too. Please note that all options are currently +interpreted in the context of the daemon process, which makes a difference +for options that specify a file descriptor (such as B<-pty-fd>). + +=head1 ENVIRONMENT + +All environment variables of the current process will be made available +to the new instance, and will be interpreted as if B<@@RXVT_NAME@@> were +started directly. + +=over 4 + +=item B + +Both @@RXVT_NAME@@c and @@RXVT_NAME@@d use the environment variable +F to create a listening socket and to contact +the @@RXVT_NAME@@d, respectively. If the variable is missing, +F<<< $HOME/.rxvt-unicode-I<< >> >>> is used. + +=back + +=head1 SEE ALSO + +@@RXVT_NAME@@(7), @@RXVT_NAME@@d(1) + diff --git a/doc/rxvtd.1.pod b/doc/rxvtd.1.pod new file mode 100644 index 0000000000000000000000000000000000000000..a66a0996e051b345a8b36c864a668a45a047a063 --- /dev/null +++ b/doc/rxvtd.1.pod @@ -0,0 +1,88 @@ +=head1 NAME + +@@RXVT_NAME@@d - @@RXVT_NAME@@ terminal daemon + +=head1 SYNOPSIS + +B<@@RXVT_NAME@@d> [-q|--quiet] [-o|--opendisplay] [-f|--fork] + +=head1 DESCRIPTION + +This manpage describes the @@RXVT_NAME@@d daemon, which is the same vt102 +terminal emulator as @@RXVT_NAME@@, but runs as a daemon that can open +multiple terminal windows within the same process. + +You can run it from your X startup scripts, for example, although it is +not dependent on a working DISPLAY and, in fact, can open windows on +multiple X displays on the same time. + +Advantages of running a @@RXVT_NAME@@ daemon include faster creation time +for terminal windows and a lot of saved memory. + +The disadvantage is a possible impact on stability - if the +main program crashes, all processes in the terminal windows are +terminated. For example, as there is no way to cleanly react to abnormal +connection closes, C and server resets/restarts will kill the +B<@@RXVT_NAME@@d> instance including all windows it has opened. + +=head1 OPTIONS + +B<@@RXVT_NAME@@d> currently understands a few options only. Bundling of +options is not yet supported. + +=over 4 + +=item B<-q>, B<--quiet> + +Normally, B<@@RXVT_NAME@@d> outputs the message C<< rxvt-unicode daemon +listening on >> after binding to its control socket. This option +will suppress this message (errors and warnings will still be logged). + +=item B<-o>, B<--opendisplay> + +This forces B<@@RXVT_NAME@@d> to open a connection to the current +C<$DISPLAY> and keep it open. + +This is useful if you want to bind an instance of B<@@RXVT_NAME@@d> to +the lifetime of a specific display/server. If the server does a reset, +B<@@RXVT_NAME@@d> will be killed automatically. + +=item B<-f>, B<--fork> + +This makes B<@@RXVT_NAME@@d> fork after it has bound itself to its control +socket. + +=back + +=head1 EXAMPLES + +This is a useful invocation of B<@@RXVT_NAME@@d> in a F<.xsession>-style +script: + + B<@@RXVT_NAME@@d> -q -f -o + +This waits till the control socket is available, opens the current display +and forks into the background. When you log-out, the server is reset and +B<@@RXVT_NAME@@d> is killed. + +=head1 ENVIRONMENT + +=over 4 + +=item B + +Both B<@@RXVT_NAME@@c> and B<@@RXVT_NAME@@d> use the environment variable +F to create a listening socket and to contact +the @@RXVT_NAME@@d, respectively. If the variable is missing, +F<<< $HOME/.rxvt-unicode-I<< >> >>> is used. + +=item B + +Only used when the C<--opendisplay> option is specified. Must contain a +valid X display name. + +=over + +=head1 SEE ALSO + +@@RXVT_NAME@@(7), @@RXVT_NAME@@c(1) diff --git a/src/init.C b/src/init.C --- a/src/init.C +++ b/src/init.C @@ -346,19 +346,7 @@ rxvt_term::init_resources (int argc, const char *const *argv) get_options (r_argc, r_argv); -#ifdef LOCAL_X_IS_UNIX - if (rs[Rs_display_name][0] == ':') - { - val = rxvt_malloc (5 + strlen (rs[Rs_display_name])); - strcpy (val, "unix"); - strcat (val, rs[Rs_display_name]); - display = displays.get (val); - free (val); - } -#endif - - if (!display - && ! (display = displays.get (rs[Rs_display_name]))) + if (!(display = displays.get (rs[Rs_display_name]))) rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]); extract_resources (); diff --git a/src/rxvtd.C b/src/rxvtd.C--- a/src/rxvtd.C +++ b/src/rxvtd.C @@ -211,19 +211,57 @@ void server::read_cb (io_watcher &w, short revents) return err (); } +int opt_fork, opt_opendisplay, opt_quiet; + int main (int argc, const char *const *argv) { + for (int i = 1; i < argc; i++) + { + if (!strcmp (argv [i], "-f") || !strcmp (argv [i], "--fork")) + opt_fork = 1; + else if (!strcmp (argv [i], "-o") || !strcmp (argv [i], "--opendisplay")) + opt_opendisplay = 1; + else if (!strcmp (argv [i], "-q") || !strcmp (argv [i], "--quiet")) + opt_quiet = 1; + else + { + rxvt_log ("%s: unknown option '%s', aborting.\n", argv [0], argv [i]); + return EXIT_FAILURE; + } + } + rxvt_init (); chdir ("/"); + if (opt_opendisplay) + displays.get (getenv ("DISPLAY")); // open display and never release it + char *sockname = rxvt_connection::unix_sockname (); unix_listener l (sockname); - printf ("rxvt-unicode daemon listening on %s.\n", sockname); - fflush (stdout); + + if (!opt_quiet) + { + printf ("rxvt-unicode daemon listening on %s.\n", sockname); + fflush (stdout); + } + free (sockname); + if (opt_fork) + { + pid_t pid = fork (); + + if (pid < 0) + { + rxvt_log ("unable to fork daemon, aborting.\n"); + return EXIT_FAILURE; + } + else if (pid > 0) + _exit (EXIT_SUCCESS); + } + io_manager::loop (); return EXIT_SUCCESS; diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C--- a/src/rxvttoolkit.C +++ b/src/rxvttoolkit.C @@ -145,7 +145,21 @@ rxvt_display::rxvt_display (const char *id) bool rxvt_display::init () { - display = XOpenDisplay (id); +#ifdef LOCAL_X_IS_UNIX + if (id[0] == ':') + { + val = rxvt_malloc (5 + strlen (id) + 1); + strcpy (val, "unix/"); + strcat (val, id); + display = XOpenDisplay (val); + free (val); + } + else + display = 0; +#endif + + if (!display) + display = XOpenDisplay (id); if (!display) return false;-----END OF PAGE-----