Skip to content

Commit

Permalink
Ensure env uses right stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-at-luther committed Dec 16, 2023
1 parent 618d7e8 commit 514a705
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion repl/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,17 @@ func RunEnv(env *lisp.LEnv, prompt, cont string, opts ...Option) {
p := rdparser.NewInteractive(nil)
p.SetPrompts(prompt, cont)

cfg := newConfig(opts...)
if cfg.stderr != nil {
env.Runtime.Stderr = cfg.stderr
}

rlCfg := &readline.Config{
Stdout: env.Runtime.Stderr,
Stderr: env.Runtime.Stderr,
Prompt: p.Prompt(),
}

cfg := newConfig(opts...)
if cfg.stdin != nil {
rlCfg.Stdin = cfg.stdin
}
Expand Down

0 comments on commit 514a705

Please sign in to comment.