David, if you choose to enforce the code freeze, please do apply the
documentation update and remove the section of the manpage that deals
with the new ``-x'' option. I'd also appreciate it if at least the
change to charset.c could get in.
The attached patch does three things:
- fixes a bug with ``-encoding'' being too strict with the syntax
(charset.c);
- adds a new ``-x'' flag that causes luit to exit as soon as the
child does (luit.c);
- documentation update to synchronise with Tomohiro's work on XTerm.
Juliusz
? xc/programs/luit/luit
Index: xc/programs/luit/charset.c
===================================================================
RCS file: /cvs/xc/programs/luit/charset.c,v
retrieving revision 1.6
diff -c -r1.6 charset.c
*** xc/programs/luit/charset.c 2002/10/17 01:06:09 1.6
--- xc/programs/luit/charset.c 2003/02/23 21:22:34
***************
*** 466,472 ****
}
for(p = localeCharsets; p->name; p++) {
! if(!strcmp(p->name, charset))
break;
}
--- 466,472 ----
}
for(p = localeCharsets; p->name; p++) {
! if(compare(p->name, charset) == 0)
break;
}
Index: xc/programs/luit/luit.c
===================================================================
RCS file: /cvs/xc/programs/luit/luit.c,v
retrieving revision 1.9
diff -c -r1.9 luit.c
*** xc/programs/luit/luit.c 2002/10/17 01:06:09 1.9
--- xc/programs/luit/luit.c 2003/02/23 21:22:34
***************
*** 53,58 ****
--- 53,59 ----
int olog = -1;
int verbose = 0;
int converter = 0;
+ int exitOnChild = 0;
volatile int sigwinch_queued = 0;
volatile int sigchld_queued = 0;
***************
*** 95,101 ****
"[ -kg0 set ] [ -kg1 set ] "
"[ -kg2 set ] [ -kg3 set ]\n"
" [ -k7 ] [ +kss ] [ +kssgr ] [ -kls ]\n"
! " [ -c ] [ -ilog filename ] [ -olog filename ] [ -- ]\n"
" [ program [ args ] ]\n");
}
--- 96,102 ----
"[ -kg0 set ] [ -kg1 set ] "
"[ -kg2 set ] [ -kg3 set ]\n"
" [ -k7 ] [ +kss ] [ +kssgr ] [ -kls ]\n"
! " [ -c ] [ -x ] [ -ilog filename ] [ -olog filename ] [ -- ]\n"
" [ program [ args ] ]\n");
}
***************
*** 255,260 ****
--- 256,264 ----
FatalError("-argv0 requires an argument\n");
child_argv0 = argv[i + 1];
i += 2;
+ } else if(!strcmp(argv[i], "-x")) {
+ exitOnChild = 1;
+ i++;
} else if(!strcmp(argv[i], "-c")) {
converter = 1;
i++;
***************
*** 564,572 ****
setWindowSize(0, pty);
}
! if(sigchld_queued) {
! /* quitting now would be a race condition */
! }
if(rc > 0) {
if(rc & 2) {
--- 568,575 ----
setWindowSize(0, pty);
}
! if(sigchld_queued && exitOnChild)
! break;
if(rc > 0) {
if(rc & 2) {
Index: xc/programs/luit/luit.man
===================================================================
RCS file: /cvs/xc/programs/luit/luit.man,v
retrieving revision 1.6
diff -c -r1.6 luit.man
*** xc/programs/luit/luit.man 2002/07/01 02:25:59 1.6
--- xc/programs/luit/luit.man 2003/02/23 21:22:34
***************
*** 2,8 ****
.TH LUIT 1 __vendorversion__
.SH NAME
luit \- Locale and ISO\ 2022 support for Unicode terminals
-
.SH SYNOPSIS
.B luit
[
--- 2,7 ----
***************
*** 14,22 ****
[
.I args
] ]
-
.SH DESCRIPTION
-
.B Luit
is a filter that can be run between an arbitrary application and a
UTF-8 terminal emulator. It will convert application output from the
--- 13,19 ----
***************
*** 28,35 ****
feature is discouraged: multilingual applications should be modified
to directly generate UTF-8 instead.
.SH OPTIONS
-
.TP
.B \-h
Display some summary help and quit.
--- 25,36 ----
feature is discouraged: multilingual applications should be modified
to directly generate UTF-8 instead.
+ .B Luit
+ is usually invoked transparently by the terminal emulator. For
+ information about running
+ .B luit
+ from the command line, see EXAMPLES below.
.SH OPTIONS
.TP
.B \-h
Display some summary help and quit.
***************
*** 43,48 ****
--- 44,54 ----
.B \-c
Function as a simple converter from standard input to standard output.
.TP
+ .B \-x
+ Exit as soon as the child dies. This may cause
+ .B luit
+ to loose data at the end of the child's output.
+ .TP
.BI \-argv0 " name"
Set the child's name (as passed in argv[0]).
.TP
***************
*** 128,179 ****
.TP
.B \-\-
End of options.
-
.SH EXAMPLES
-
The most typical use of
.B luit
is to adapt an instance of
.B XTerm
! in UTF-8 mode to the locale's encoding. For most locales, this
! doesn't require using any flags:
.IP
$ xterm \-u8 \-e luit
.PP
!
! .B Luit
! may also be used with applications that hard-wire an encoding that is
! different from the one normally used on the system. In order to use
! such applications, you will need to directly manipulate
! .BR luit 's
! ISO\ 2022 state:
.IP
! $ xterm \-u8 \-e luit \-g2 'CP 1252'
.PP
! The
! .B \-v
! flag may be used in order to examine
! .BR luit 's
! initial state.
!
! Future versions of
! .B XTerm
! will automatically invoke
.B luit
! when necessary.
!
.SH FILES
-
.TP
.B __projectroot__/lib/X11/fonts/encodings/encodings.dir
The system-wide encodings directory.
-
.TP
.B __projectroot__/lib/X11/locale/locale.alias
The file mapping locales to locale encodings.
-
.SH SECURITY
-
On systems with SVR4 (``Unix-98'') ptys (Linux version 2.2 and later,
SVR4),
.B luit
--- 134,188 ----
.TP
.B \-\-
End of options.
.SH EXAMPLES
The most typical use of
.B luit
is to adapt an instance of
.B XTerm
! to the locale's encoding. Current versions of
! .B XTerm
! invoke
! .B luit
! automatically when it is needed. If you are using an older release of
! .BR XTerm ,
! or a different terminal emulator, you may invoke
! .B luit
! manually:
.IP
$ xterm \-u8 \-e luit
.PP
! If you are running in a UTF-8 locale but need to access a remote
! machine that doesn't support UTF-8,
! .B luit
! can adapt the remote output to your terminal:
.IP
! $ LC_ALL=fr_FR luit ssh legacy-machine
.PP
! .B Luit
! is also useful with applications that hard-wire an encoding that is
! different from the one normally used on the system or want to use
! legacy escape sequences for multilingual output. In particular,
! versions of
! .B Emacs
! that do not speak UTF-8 well can use
.B luit
! for multilingual output:
! .IP
! $ luit -encoding 'ISO 8859-1' emacs -nw
! .PP
! And then, in
! .BR Emacs ,
! .IP
! M-x set-terminal-coding-system RET iso-2022-8bit-ss2 RET
! .PP
.SH FILES
.TP
.B __projectroot__/lib/X11/fonts/encodings/encodings.dir
The system-wide encodings directory.
.TP
.B __projectroot__/lib/X11/locale/locale.alias
The file mapping locales to locale encodings.
.SH SECURITY
On systems with SVR4 (``Unix-98'') ptys (Linux version 2.2 and later,
SVR4),
.B luit
***************
*** 195,201 ****
.B Luit
will refuse to run if it is installed setuid and the underlying system
does not have POSIX saved ids.
-
.SH BUGS
None of this complexity should be necessary. Stateless UTF-8
throughout the system is the way to go.
--- 204,209 ----
***************
*** 204,215 ****
Selecting alternate sets of control characters is not supported and
will never be.
-
.SH SEE ALSO
xterm(1), unicode(7), utf-8(7), charsets(7).
.I Character Code Structure and Extension Techniques (ISO\ 2022, ECMA-35).
.I Control Functions for Coded Character Sets (ISO\ 6429, ECMA-48).
-
.SH AUTHOR
Luit was written by Juliusz Chroboczek <[EMAIL PROTECTED]> for the
XFree86 project.
--- 212,221 ----