Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new arguments (enhancements especially when used in scripted environments) #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cipriancraciun
Copy link

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant