Skip to content

Commit ebbc35b

Browse files
committed
Pre commands inherit stderr from main process
This has two main benefits: 1) Errors during preprocessing are now visible (not on the slides themselves but back on the console after exiting), which helps with debugging. 2) Subprocesses are able to do fine-grained formatting, as terminfo commands now work properly. For example, `tput cols` and `tput lines` now return the correct terminal size instead of the defalt 80x24.
1 parent da04294 commit ebbc35b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/process/process.go

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package process
33
import (
44
"fmt"
55
"io"
6+
"os"
67
"os/exec"
78
"regexp"
89
"strings"
@@ -51,6 +52,7 @@ func Parse(markdown string) []Block {
5152
func (b *Block) Execute() {
5253
c := strings.Split(b.Command, " ")
5354
cmd := exec.Command(c[0], c[1:]...)
55+
cmd.Stderr = os.Stderr;
5456
stdin, err := cmd.StdinPipe()
5557
if err != nil {
5658
return

0 commit comments

Comments
 (0)