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

Allow customizing the RunningCommand class #613

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ class Command(object):
RunningCommand object, which represents the Command put into an execution
state. """
thread_local = threading.local()
RunningCommandCls = RunningCommand

_call_args = {
"fg": False, # run command in foreground
Expand Down Expand Up @@ -1521,7 +1522,7 @@ def __call__(self, *args, **kwargs):
if output_redirect_is_filename(stderr):
stderr = open(str(stderr), "wb")

return RunningCommand(cmd, call_args, stdin, stdout, stderr)
return self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)


def compile_args(a, kwargs, sep, prefix):
Expand Down