I have made three (quite minor) changes, that are most helpful in scripted scenarios, where dtach is used behind the scenes. Namely:
add support for -- argument termination marker (just like other Linux tools), which allows one to have executables starting with -; another side-effect of this patch is that in case dtach is used in a script where we can't trust the user input, now the user is not able to inject new options that are interpreted by dtach; (for example it is used like dtach -c socket -- ${@};
add support for -q option which, like other Linux tools makes dtach exit quietly if everything is OK; basically it doesn't print anymore [EOS ...]; in conjunction with the other patches which introduce the -R option, it makes dtach transparent when used in scripts;
add support for -R (the symmetric argument for -r), which allows the user how the terminal is cleared when the command exits or is detached; the two options are move (the current behavior) and none, which just prints a new line; the second variant allows one to use dtach in a loop for short commands, and still be able to read their output without having to scroll; (one use-case is for example in a Jenkins job;)
If these patches are accepted I can also provide the necessary man updates. (For now I have only added the embedded help documentation.)
I have made three (quite minor) changes, that are most helpful in scripted scenarios, where
dtach
is used behind the scenes. Namely:add support for
--
argument termination marker (just like other Linux tools), which allows one to have executables starting with-
; another side-effect of this patch is that in casedtach
is used in a script where we can't trust the user input, now the user is not able to inject new options that are interpreted bydtach
; (for example it is used likedtach -c socket -- ${@}
;add support for
-q
option which, like other Linux tools makesdtach
exit quietly if everything is OK; basically it doesn't print anymore[EOS ...]
; in conjunction with the other patches which introduce the-R
option, it makesdtach
transparent when used in scripts;add support for
-R
(the symmetric argument for-r
), which allows the user how the terminal is cleared when the command exits or is detached; the two options aremove
(the current behavior) andnone
, which just prints a new line; the second variant allows one to usedtach
in a loop for short commands, and still be able to read their output without having to scroll; (one use-case is for example in a Jenkins job;)If these patches are accepted I can also provide the necessary
man
updates. (For now I have only added the embedded help documentation.)