1dtach(1)                    General Commands Manual                   dtach(1)
2
3
4

NAME

6       dtach - simple program that emulates the detach feature of screen.
7

SYNOPSIS

9       dtach -a <socket> <options>
10       dtach -A <socket> <options> <command...>
11       dtach -c <socket> <options> <command...>
12       dtach -n <socket> <options> <command...>
13
14

DESCRIPTION

16       dtach  is  a  program that emulates the detach feature of screen. It is
17       designed to be transparent and un-intrusive; it avoids interpreting the
18       input  and  output between attached terminals and the program under its
19       control. Consequently, it works best with full-screen applications such
20       as emacs.
21
22       dtach is intended for users who want the detach feature of screen with‐
23       out the other overhead of  screen.  It  is  tiny,  does  not  use  many
24       libraries, and stays out of the way as much as possible.
25
26
27   SESSIONS
28       A  session  in dtach is a single instance in which a program is running
29       under the control of dtach.  The  program  is  disassociated  from  the
30       original  terminal,  and  is thus protected from your original terminal
31       being disconnected for some reason.
32
33       Other instances of dtach can attach themselves to a particular session.
34       Input  and  output  is  copied between the program running in the dtach
35       session, and the attached terminals.
36
37       dtach avoids interpreting the communication stream between the  program
38       and  the  attached  terminals;  it instead relies on the ability of the
39       attached terminals to manage the screen.
40
41       Sessions are represented by Unix-domain sockets in the  filesystem.  No
42       other  permission  checking  other than the filesystem access checks is
43       performed.  dtach creates a master process that  monitors  the  session
44       socket, the program, and any attached terminals.
45
46
47   MODES
48       dtach  has  several  modes of operation. It can create a new session in
49       which a program is executed, or it can attach to an  existing  session.
50       The first argument specifies which mode dtach should operate in.
51
52       -a     Attach  to  an  existing  session.  dtach attaches itself to the
53              session specified by <socket>.  After the attach  is  completed,
54              the  window  size  of the current terminal is sent to the master
55              process, and a redraw is also requested.
56
57       -A     Attach to an existing session, or create a new one.  dtach first
58              tries  to  attach to the session specified by <socket> if possi‐
59              ble. If the attempt to open the socket  fails,  dtach  tries  to
60              create a new session before attaching to it.
61
62       -c     Creates  a  new  session.  A new session is created in which the
63              specified program is  executed.   dtach  then  tries  to  attach
64              itself to the newly created session.
65
66       -n     Creates a new session, without attaching to it. A new session is
67              created in which the specified program is executed.  dtach  does
68              not  try  to  attach  to the newly created session, however, and
69              exits instead.
70
71
72   OPTIONS
73       dtach has a few options that allow you to  modify  its  behavior.  Each
74       attaching  process  can have separate settings for these options, which
75       allows for some flexibility.
76
77
78       -e <char>
79              Sets the detach character to <char>.  When the detach  character
80              is  pressed,  dtach detaches itself from the current session and
81              exits. The process running in the session is unaffected  by  the
82              detach. By default, the detach character is set to ^\ (Ctrl-\).
83
84
85       -E     Disables the detach character.  dtach does not try to scan input
86              from the terminal for a detach character. The only way to detach
87              from  the  session  is  then by sending the attaching process an
88              appropriate signal.
89
90
91       -r <method>
92              Sets the redraw method to <method>.  The valid methods are none,
93              ctrl_l, or winch.
94
95              none  disables redrawing completely, ctrl_l sends a Ctrl L char‐
96              acter to the program if the terminal is  in  character-at-a-time
97              and  no-echo mode, and winch forces a WINCH signal to be sent to
98              the program.
99
100              When creating a new session, the specified method is used as the
101              default  redraw  method  for  the session. If not specified, the
102              ctrl_l method is used.
103
104
105       -z     Disables processing of the suspend key.   Normally,  dtach  will
106              suspend  itself  when  the  suspend  key  is  pressed. With this
107              option, the suspend character is sent to the session instead  of
108              being handled by dtach.
109
110

EXAMPLES

112       The following example creates a new session that has the detach charac‐
113       ter and suspend processing disabled. A socket is created  in  the  /tmp
114       directory for the session.
115
116          $ dtach -c /tmp/foozle -Ez bash
117
118       The following example attaches to the /tmp/foozle session if it exists,
119       and if not, creates a new session using /tmp/foozle as the  socket  for
120       the  session.  Processing of the suspend character is also disabled for
121       the attach instance.
122
123          $ dtach -A /tmp/foozle -z bash
124
125       The following example attaches to the /tmp/foozle  session,  using  the
126       winch redraw method to redraw the screen.
127
128          $ dtach -a /tmp/foozle -r winch
129
130       The following example creates a new session and sets the default redraw
131       method for the session to the winch redraw method.
132
133          $ dtach -c /tmp/foozle -r winch bash
134
135

AUTHOR

137       Ned T. Crigler <crigler@users.sourceforge.net>.
138
139

SEE ALSO

141       screen(1)
142
143
144
145dtach 0.7                          Jul 2004                           dtach(1)
Impressum