I don't know whether you would want this in the man page, the readme, or a new FAQ document.
Q: How can I see my currently running dtach sessions?
A: There are a few ways:
pgrep -afi dtach
lsof -U | grep dtach
lsof ~/.dtach/* This assumes, of course, that you put your sockets in ~/.dtach/. Edit the directory name as needed.
Q: How can I rename a dtach session?
A: Rename the socket, e.g. mv /tmp/foozle /tmp/foobar. Note that the process name will still refer to the original name, but you can connect only to the new name, e.g. dtach -a /tmp/foobar.
Q: How can I make a new name for a dtach session, keeping the original name?
A: Make a symbolic link to the socket, e.g. ln -s /tmp/foozle /tmp/anothername. This can be thought of as a non-destructive renaming. dtach will not automatically delete the symbolic link; you'll need to manage that for yourself.
Q: How can I stop a dtach session?
A: You can attach to the session and exit from whatever program is running. If you want to do it faster, you can kill the process.
Q: These methods for managing dtach sessions include external shell commands. Why doesn't dtach handle this functionality within itself?
A: Dtach is kept small and simple in order to facilitate easy understanding and maintenance, and minimization of bugs.
Q: How do I specify the escape character with the -e option?
A: Dtach requires that the escape character be an ASCII control character, i.e. have a value between 0 and 31. There are two ways of expressing it: directly/literally or indirectly.
- To be direct, use the actual control character on the command line. Exactly how to do this will depend on your shell. With Bash, for example, put quotes around it and precede it with either Ctrl-V or Ctrl-Q.
- Alternatively, you can give dtach -e option a two character string: the first character must be a circumflex and the second character is the key held down while pressing control. For example, ^@ means NUL, ^G or ^g means BEL, and ^[ means ESC. Use
man 7 ascii for reference.
I don't know whether you would want this in the man page, the readme, or a new FAQ document.
Q: How can I see my currently running dtach sessions?
A: There are a few ways:
pgrep -afi dtachlsof -U | grep dtachlsof ~/.dtach/*This assumes, of course, that you put your sockets in~/.dtach/. Edit the directory name as needed.Q: How can I rename a dtach session?
A: Rename the socket, e.g.
mv /tmp/foozle /tmp/foobar. Note that the process name will still refer to the original name, but you can connect only to the new name, e.g.dtach -a /tmp/foobar.Q: How can I make a new name for a dtach session, keeping the original name?
A: Make a symbolic link to the socket, e.g.
ln -s /tmp/foozle /tmp/anothername. This can be thought of as a non-destructive renaming. dtach will not automatically delete the symbolic link; you'll need to manage that for yourself.Q: How can I stop a dtach session?
A: You can attach to the session and exit from whatever program is running. If you want to do it faster, you can kill the process.
Q: These methods for managing dtach sessions include external shell commands. Why doesn't dtach handle this functionality within itself?
A: Dtach is kept small and simple in order to facilitate easy understanding and maintenance, and minimization of bugs.
Q: How do I specify the escape character with the -e option?
A: Dtach requires that the escape character be an ASCII control character, i.e. have a value between 0 and 31. There are two ways of expressing it: directly/literally or indirectly.
man 7 asciifor reference.