From: root
Date: Thu, 22 Dec 2005 16:44:10 +0000 (+0000)
Subject: *** empty log message ***
X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=323d1831d58ebbad66ea28e03d8e8257b20ac62f;p=dana%2Furxvt.git
*** empty log message ***
---
diff --git a/Changes b/Changes
index 9ca1b702..3d20f0e5 100644
--- a/Changes
+++ b/Changes
@@ -22,6 +22,7 @@ WISH: just for fun, do shade and tint with XRender.
- bump max columns/rows to 10000 each.
- bump max savelines to 10000000.
- major code cleanup (still not complete, though).
+ - implement -hold option.
- _major_ rewrite of internal buffer handling:
- re-flow on resize, lines get wrapped instead of winged.
- circular line buffer (substantially speeds up scrolling).
diff --git a/README.configure b/README.configure
index 6d36e790..788fbca1 100644
--- a/README.configure
+++ b/README.configure
@@ -197,7 +197,7 @@ CONFIGURE OPTIONS
settable insecure mode
keysym remapping support
cursor blinking and underline cursor
- -embed and -pty-fd options
+ -embed, -pty-fd and -hold options
--enable-iso14755 (default: on)
Enable extended ISO 14755 support (see rxvt(1), or doc/rxvt.1.txt).
diff --git a/doc/rxvt.1.html b/doc/rxvt.1.html
index c2b73683..c726af63 100644
--- a/doc/rxvt.1.html
+++ b/doc/rxvt.1.html
@@ -48,7 +48,7 @@
-rxvt-unicode, version 5.9, is a colour vt102 terminal
+
rxvt-unicode, version 6.0, 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 --
@@ -436,6 +436,14 @@ on the command-line. If there is no -e option then the default
run the program specified by the SHELL environment variable or,
failing that, sh(1).
+
+Please note that you must specify a program with arguments. If you want to
+run shell commands, you have to specify the shell, like this:
+
+
+
+ rxvt -e sh -c "shell commands"
+
-title text
@@ -526,6 +534,15 @@ Turn on/off secondary screen scroll (default enabled); resource
secondaryScroll.
+-hold|+hold
+
+
+Turn on/off hold window after exit support. If enabled, rxvt
+will not immediately destroy its window when the program executed within
+it exits. Instead, it will wait till it is being killed or closed by the
+user; resource hold.
+
+
-keysym.sym string
@@ -1252,6 +1269,15 @@ scrollback buffer and switching to/from the secondary screen will
instead scroll the screen up.
+hold: bool
+
+
+Turn on/off hold window after exit support. If enabled, rxvt
+will not immediately destroy its window when the program executed within
+it exits. Instead, it will wait till it is being killed or closed by the
+user.
+
+
keysym.sym: string
diff --git a/doc/rxvt.1.man.in b/doc/rxvt.1.man.in
index 23da0bb6..43ef7b96 100644
--- a/doc/rxvt.1.man.in
+++ b/doc/rxvt.1.man.in
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "rxvt 1"
-.TH rxvt 1 "2005-12-17" "5.9" "RXVT-UNICODE"
+.TH rxvt 1 "2005-12-22" "6.0" "RXVT-UNICODE"
.SH "NAME"
rxvt\-unicode (ouR XVT, unicode) \- (a VT102 emulator for the X window system)
.SH "SYNOPSIS"
@@ -401,6 +401,13 @@ given on the command line. If this option is used, it must be the last
on the command\-line. If there is no \fB\-e\fR option then the default is to
run the program specified by the \fB\s-1SHELL\s0\fR environment variable or,
failing that, \fI\fIsh\fI\|(1)\fR.
+.Sp
+Please note that you must specify a program with arguments. If you want to
+run shell commands, you have to specify the shell, like this:
+.Sp
+.Vb 1
+\& @@RXVT_NAME@@ -e sh -c "shell commands"
+.Ve
.IP "\fB\-title\fR \fItext\fR" 4
.IX Item "-title text"
Window title (\fB\-T\fR still respected); the default title is the basename
@@ -454,6 +461,12 @@ Turn on/off secondary screen (default enabled); resource
.IX Item "-ssr|+ssr"
Turn on/off secondary screen scroll (default enabled); resource
\&\fBsecondaryScroll\fR.
+.IP "\fB\-hold\fR|\fB+hold\fR" 4
+.IX Item "-hold|+hold"
+Turn on/off hold window after exit support. If enabled, @@RXVT_NAME@@
+will not immediately destroy its window when the program executed within
+it exits. Instead, it will wait till it is being killed or closed by the
+user; resource \fBhold\fR.
.IP "\fB\-keysym.\fR\fIsym\fR \fIstring\fR" 4
.IX Item "-keysym.sym string"
Remap a key symbol. See resource \fBkeysym\fR.
@@ -949,6 +962,12 @@ Turn on/off secondary screen scroll (default enabled). If the this
option is enabled, scrolls on the secondary screen will change the
scrollback buffer and switching to/from the secondary screen will
instead scroll the screen up.
+.IP "\fBhold\fR: \fIbool\fR" 4
+.IX Item "hold: bool"
+Turn on/off hold window after exit support. If enabled, @@RXVT_NAME@@
+will not immediately destroy its window when the program executed within
+it exits. Instead, it will wait till it is being killed or closed by the
+user.
.IP "\fBkeysym.\fR\fIsym\fR: \fIstring\fR" 4
.IX Item "keysym.sym: string"
Compile \fIfrills\fR: Associate \fIstring\fR with keysym \fIsym\fR. The
diff --git a/doc/rxvt.1.pod b/doc/rxvt.1.pod
index 08d0a2cd..cac1156f 100644
--- a/doc/rxvt.1.pod
+++ b/doc/rxvt.1.pod
@@ -315,6 +315,11 @@ on the command-line. If there is no B<-e> option then the default is to
run the program specified by the B environment variable or,
failing that, I.
+Please note that you must specify a program with arguments. If you want to
+run shell commands, you have to specify the shell, like this:
+
+ @@RXVT_NAME@@ -e sh -c "shell commands"
+
=item B<-title> I
Window title (B<-T> still respected); the default title is the basename
@@ -380,6 +385,13 @@ B.
Turn on/off secondary screen scroll (default enabled); resource
B.
+=item B<-hold>|B<+hold>
+
+Turn on/off hold window after exit support. If enabled, @@RXVT_NAME@@
+will not immediately destroy its window when the program executed within
+it exits. Instead, it will wait till it is being killed or closed by the
+user; resource B.
+
=item B<-keysym.>I I
Remap a key symbol. See resource B.
@@ -933,6 +945,13 @@ option is enabled, scrolls on the secondary screen will change the
scrollback buffer and switching to/from the secondary screen will
instead scroll the screen up.
+=item B: I
+
+Turn on/off hold window after exit support. If enabled, @@RXVT_NAME@@
+will not immediately destroy its window when the program executed within
+it exits. Instead, it will wait till it is being killed or closed by the
+user.
+
=item BI: I
Compile I: Associate I with keysym I. The
diff --git a/doc/rxvt.1.txt b/doc/rxvt.1.txt
index 215f3032..9f24267c 100644
--- 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.9, is a colour vt102 terminal emulator intended
+ rxvt-unicode, version 6.0, 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
@@ -269,6 +269,12 @@ OPTIONS
run the program specified by the SHELL environment variable or,
failing that, *sh(1)*.
+ Please note that you must specify a program with arguments. If you
+ want to run shell commands, you have to specify the shell, like
+ this:
+
+ rxvt -e sh -c "shell commands"
+
-title *text*
Window title (-T still respected); the default title is the basename
of the program specified after the -e option, if any, otherwise the
@@ -321,6 +327,12 @@ OPTIONS
Turn on/off secondary screen scroll (default enabled); resource
secondaryScroll.
+ -hold|+hold
+ Turn on/off hold window after exit support. If enabled, rxvt will
+ not immediately destroy its window when the program executed within
+ it exits. Instead, it will wait till it is being killed or closed by
+ the user; resource hold.
+
-keysym.*sym* *string*
Remap a key symbol. See resource keysym.
@@ -800,6 +812,12 @@ RESOURCES (available also as long-options)
scrollback buffer and switching to/from the secondary screen will
instead scroll the screen up.
+ hold: *bool*
+ Turn on/off hold window after exit support. If enabled, rxvt will
+ not immediately destroy its window when the program executed within
+ it exits. Instead, it will wait till it is being killed or closed by
+ the user.
+
keysym.*sym*: *string*
Compile *frills*: Associate *string* with keysym *sym*. The
intervening resource name keysym. cannot be omitted.
diff --git a/doc/rxvt.7.html b/doc/rxvt.7.html
index b3344a77..ae573ae2 100644
--- a/doc/rxvt.7.html
+++ b/doc/rxvt.7.html
@@ -2829,7 +2829,7 @@ in combination with other switches) is:
settable insecure mode
keysym remapping support
cursor blinking and underline cursor
- -embed and -pty-fd options
+ -embed, -pty-fd and -hold options
--enable-iso14755 (default: on)
diff --git a/doc/rxvt.7.man.in b/doc/rxvt.7.man.in
index e4df8c9b..de230bc1 100644
--- a/doc/rxvt.7.man.in
+++ b/doc/rxvt.7.man.in
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
+.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -129,7 +129,7 @@
.\" ========================================================================
.\"
.IX Title "rxvt 7"
-.TH rxvt 7 "2005-12-17" "5.9" "RXVT-UNICODE"
+.TH rxvt 7 "2005-12-22" "6.0" "RXVT-UNICODE"
.SH "NAME"
RXVT REFERENCE \- FAQ, command sequences and other background information
.SH "SYNOPSIS"
@@ -2390,7 +2390,7 @@ in combination with other switches) is:
\& settable insecure mode
\& keysym remapping support
\& cursor blinking and underline cursor
-\& -embed and -pty-fd options
+\& -embed, -pty-fd and -hold options
.Ve
.IP "\-\-enable\-iso14755 (default: on)" 4
.IX Item "--enable-iso14755 (default: on)"
diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod
index bad66160..b0acdace 100644
--- a/doc/rxvt.7.pod
+++ b/doc/rxvt.7.pod
@@ -2417,7 +2417,7 @@ in combination with other switches) is:
settable insecure mode
keysym remapping support
cursor blinking and underline cursor
- -embed and -pty-fd options
+ -embed, -pty-fd and -hold options
=item --enable-iso14755 (default: on)
diff --git a/doc/rxvt.7.txt b/doc/rxvt.7.txt
index 67001253..a394eba2 100644
--- a/doc/rxvt.7.txt
+++ b/doc/rxvt.7.txt
@@ -1868,7 +1868,7 @@ CONFIGURE OPTIONS
settable insecure mode
keysym remapping support
cursor blinking and underline cursor
- -embed and -pty-fd options
+ -embed, -pty-fd and -hold options
--enable-iso14755 (default: on)
Enable extended ISO 14755 support (see rxvt(1), or doc/rxvt.1.txt).
diff --git a/src/command.C b/src/command.C
index e5b83150..81c2f807 100644
--- a/src/command.C
+++ b/src/command.C
@@ -1069,8 +1069,8 @@ rxvt_term::pty_fill ()
cmdbuf_endp += n;
return true;
}
- else if (n < 0 && errno != EAGAIN)
- destroy ();
+ else if (n < 0 && errno != EAGAIN && errno != EINTR)
+ pty_ev.stop ();
return false;
}
@@ -4374,8 +4374,7 @@ void rxvt_term::pty_write ()
memmove (v_buffer, v_buffer + written, v_buflen);
}
else if (written != -1 || (errno != EAGAIN && errno != EINTR))
- // original code just ignores this...
- destroy ();
+ pty_ev.set (EVENT_READ);
}
/*----------------------- end-of-file (C source) -----------------------*/
diff --git a/src/main.C b/src/main.C
index adb86570..b105af0f 100644
--- a/src/main.C
+++ b/src/main.C
@@ -290,6 +290,15 @@ rxvt_term::~rxvt_term ()
#endif
}
+void
+rxvt_term::child_exit ()
+{
+ cmd_pid = 0;
+
+ if (!(options & Opt_hold))
+ destroy ();
+}
+
void
rxvt_term::destroy ()
{
@@ -524,7 +533,7 @@ static struct sig_handlers
for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
if (pid == (*t)->cmd_pid)
{
- (*t)->destroy ();
+ (*t)->child_exit ();
break;
}
}
diff --git a/src/rxvt.h b/src/rxvt.h
index 440f6612..439135c0 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -631,11 +631,12 @@ enum {
Rs_transparent_all,
#endif
#if ENABLE_FRILLS
+ Rs_pty_fd,
+ Rs_hold,
Rs_ext_bwidth,
Rs_int_bwidth,
Rs_borderLess,
Rs_lineSpace,
- Rs_pty_fd,
Rs_cursorUnderline,
#endif
#if CURSOR_BLINK
@@ -1324,6 +1325,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
rxvt_term ();
~rxvt_term ();
+ void child_exit (); // child has exited, usually destroys
void destroy ();
void emergency_cleanup ();
diff --git a/src/rxvtlib.h.in b/src/rxvtlib.h.in
index 5d1153df..dbc2f2f1 100644
--- a/src/rxvtlib.h.in
+++ b/src/rxvtlib.h.in
@@ -255,9 +255,11 @@ typedef struct {
#if ENABLE_FRILLS
# define Opt_insecure (1UL<<24) // insecure esc sequences
# define Opt_borderLess (1UL<<25) // mem borderless hints
+# define Opt_hold (1UL<<26) // hold window open after exit
#else
# define Opt_insecure 0
# define Opt_borderLess 0
+# define Opt_hold 0
#endif
/* place holder used for parsing command-line options */
#define Opt_Reverse (1UL<<30)
diff --git a/src/xdefaults.C b/src/xdefaults.C
index ab0e76d2..25a56a34 100644
--- a/src/xdefaults.C
+++ b/src/xdefaults.C
@@ -224,6 +224,7 @@ optList[] = {
#endif
#if ENABLE_FRILLS
STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"),
+ BOOL (Rs_hold, "hold", "hold", Opt_hold, "retain window after shell exit"),
STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"),
STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL),
STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL),