This repository was archived by the owner on Feb 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcondom.1
More file actions
109 lines (98 loc) · 1.71 KB
/
condom.1
File metadata and controls
109 lines (98 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.TH condom 1
.SH NAME
condom \- wrap a pseudo-terminal around a program
.SH SYNOPSIS
.B condom
.I program
.B [
.I arg ...
.B ]
.B ttyprotect
.I program
.B [
.I arg ...
.B ]
.SH DESCRIPTION
.B condom,
which is really just
.B pty -0,
runs a program under a pseudo-terminal
with as little interpretation as possible.
.B ttyprotect
is an alternate name for
.B condom.
The following are the most noticeable effects of
.B condom:
1. The
.B stdio(3)
routines
will, by default,
line-buffer their output rather than
waiting for a big block of output
to accumulate.
2.
.B condom
always exits with exit code 0,
provided nothing unusual happens.
3.
The original terminal
is always in line-by-line,
echo mode (or whatever mode it is
in originally).
4.
End-of-file
in the input does not result in an end-of-file for
.I program.
(This is an inherent and unfortunate restriction
of the current pseudo-terminal design.)
The
.B nobuf(1)
wrapper does transmit end-of-file.
5.
If
.I program
refers to /dev/tty,
it will see the pseudo-terminal
(i.e., its input and output)
rather than its original terminal.
6.
Various signals
to
.B condom
will be forwarded to
.I program
as HUPs instead.
.B condom
is most useful for making sure that
.I program
does not affect the
tty in any strange way,
particularly during debugging.
It is also useful for its effect on buffering:
several
.B condoms
may appear in a pipeline.
For instance,
.EX
last | condom grep phoenix | more
.EE
provides much faster turnaround than the same pipeline without
.B condom,
as
the
.B grep
no longer buffers its output.
For a more complete description of
.B pty,
see the
.B pty(1),
.B pty-basic(1),
and
.B pty-opts(1)
man pages.
.SH "SEE ALSO"
pty(1),
pty-basic(1),
pty-opts(1),
setbuf(3),
pty(4)