-
Notifications
You must be signed in to change notification settings - Fork 4
/
dtach.1
200 lines (175 loc) · 5.16 KB
/
dtach.1
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
.TH dtach 1 "Jan 2008" "dtach 0.8"
.SH NAME
dtach \- simple program that emulates the detach feature of screen.
.SH SYNOPSIS
.B dtach \-a
.I <socket> <options>
.br
.B dtach \-A
.I <socket> <options> <command...>
.br
.B dtach \-c
.I <socket> <options> <command...>
.br
.B dtach \-n
.I <socket> <options> <command...>
.SH DESCRIPTION
.B dtach
is a program that emulates the detach feature of screen. It is designed
to be transparent and un-intrusive; it avoids interpreting the input and output
between attached terminals and the program under its control. Consequently, it
works best with full-screen applications such as emacs.
.B dtach
is intended for users who want the detach feature of screen without the other
overhead of screen. It is tiny, does not use many libraries, and stays
out of the way as much as possible.
.SS SESSIONS
A session in
.B dtach
is a single instance in which a program is running under the control of
.BR dtach .
The program is disassociated from the original terminal, and is thus protected
from your original terminal being disconnected for some reason.
.PP
Other instances of
.B dtach
can attach themselves to a particular session. Input and output is copied
between the program running in the
.B dtach
session, and the attached terminals.
.PP
.B dtach
avoids interpreting the communication stream between the program and the
attached terminals; it instead relies on the ability of the attached terminals
to manage the screen.
.PP
Sessions are represented by Unix-domain sockets in the filesystem. No other
permission checking other than the filesystem access checks is performed.
.B dtach
creates a master process that monitors the session socket, the program, and any
attached terminals.
.PP
.SS MODES
.B dtach
has several modes of operation. It can create a new session in which a
program is executed, or it can attach to an existing session. The first
argument specifies which mode
.B dtach
should operate in.
.TP
.B \-a
Attach to an existing session.
.B dtach
attaches itself to the session specified by
.IR <socket> .
After the attach is completed, the window size of the current terminal is sent
to the master process, and a redraw is also requested.
.TP
.B \-A
Attach to an existing session, or create a new one.
.B dtach
first tries to attach to the session specified by
.I <socket>
if possible. If the attempt to open the socket fails,
.B dtach
tries to create a new session before attaching to it.
.TP
.B \-c
Creates a new session. A new session is created in which the specified program
is executed.
.B dtach
then tries to attach itself to the newly created session.
.TP
.B \-n
Creates a new session, without attaching to it. A new session is created in
which the specified program is executed.
.B dtach
does not try to attach to the newly created session, however, and exits
instead.
.PP
.SS OPTIONS
.B dtach
has a few options that allow you to modify its behavior. Each attaching
process can have separate settings for these options, which allows for
some flexibility.
.TP
.BI "\-e " "<char>"
Sets the detach character to
.IR <char> .
When the detach character is pressed,
.B dtach
detaches itself from the current session and exits. The process running in
the session is unaffected by the detach. By default, the detach character is
set to ^\e (Ctrl-\e).
.TP
.B \-E
Disables the detach character.
.B dtach
does not try to scan input from the terminal for a detach character. The only
way to detach from the session is then by sending the attaching process an
appropriate signal.
.TP
.BI "\-r " "<method>"
Sets the redraw method to
.IR <method> .
The valid methods are
.IR none ,
.IR ctrl_l ,
or
.IR winch .
.I none
disables redrawing completely,
.I ctrl_l
sends a Ctrl L character to the program if the terminal is in
character-at-a-time and no-echo mode, and
.I winch
forces a WINCH signal to be sent to the program.
When creating a new session, the specified method is used as the default
redraw method for the session. If not specified, the
.I ctrl_l
method is used.
.TP
.B \-z
Disables processing of the suspend key.
Normally,
.B dtach
will suspend itself when the suspend key is pressed. With this option, the
suspend character is sent to the session instead of being handled by
.BR dtach .
.PP
.SH EXAMPLES
The following example creates a new session that has the detach character
and suspend processing disabled. A socket is created in the /tmp directory
for the session.
.nf
$ dtach \-c /tmp/foozle \-Ez bash
.fi
The following example attaches to the /tmp/foozle session if it exists, and if
not, creates a new session using /tmp/foozle as the socket for the session.
Processing of the suspend character is also disabled for the attach instance.
.nf
$ dtach \-A /tmp/foozle \-z bash
.fi
The following example attaches to the /tmp/foozle session, using the
.I winch
redraw method to redraw the screen.
.nf
$ dtach \-a /tmp/foozle \-r winch
.fi
The following example creates a new session and sets the default redraw method
for the session to the
.I winch
redraw method.
.nf
$ dtach \-c /tmp/foozle \-r winch bash
.fi
.PP
.SH AUTHORS
.TP
2004\-2008
Ned T. Crigler <[email protected]>, original author
.TP
2011
Devin J. Pohly <[email protected]>
.SH "SEE ALSO"
.BR screen "(1)"