fix stdout/stderr formatting

This commit is contained in:
Daylin Morgan 2025-01-23 11:41:29 -06:00
parent a259bbc8a7
commit 74a6a2e25c
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -57,21 +57,16 @@ proc runCmdCapt*(
close p close p
proc formatStdoutStderr(stdout: string, stderr: string): string = proc formatStdoutStderr(stdout: string, stderr: string): string =
template addLine = template show(stream: string) =
# TODO: make -> red after hwylterm update if stream.strip() != "":
result.add "-> " result.add astToStr(stream) & ":\n"
result.add line for line in stream.splitlines():
result.add "\n" # TODO: make -> red after hwylterm update
result.add "-> "
result.add "stdout:\n" result.add line
for line in stdout.splitLines(): result.add "\n"
addLine show(stdout)
show(stderr)
result.add "stdout:\n"
for line in stderr.splitLines():
addLine
proc runCmdCaptWithSpinner*( proc runCmdCaptWithSpinner*(
cmd: string, cmd: string,