Merge pull request #115 from ameramayreh/issue-114

Handled Issue #114
This commit is contained in:
paul-gauthier 2023-07-17 04:09:40 -07:00 committed by GitHub
commit f1cc8acc0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -333,6 +333,7 @@ class Commands:
def cmd_run(self, args):
"Run a shell command and optionally add the output to the chat"
combined_output = None
try:
parsed_args = shlex.split(args)
result = subprocess.run(
@ -342,6 +343,9 @@ class Commands:
except Exception as e:
self.io.tool_error(f"Error running command: {e}")
if combined_output is None:
return
self.io.tool_output(combined_output)
if self.io.confirm_ask("Add the output to the chat?", default="y"):