Skip to content

Commit

Permalink
Fix tcell test case
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed May 14, 2024
1 parent 86d92c1 commit 8a110e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ type Terminal struct {
slab *util.Slab
theme *tui.ColorTheme
tui tui.Renderer
ttyin *os.File
executing *util.AtomicBool
termSize tui.TermSize
lastAction actionType
Expand Down Expand Up @@ -801,6 +802,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
serverOutputChan: make(chan string),
eventChan: make(chan tui.Event, 6), // (load + result + zero|one) | (focus) | (resize) | (GetChar)
tui: renderer,
ttyin: tui.TtyIn(),
initFunc: func() error { return renderer.Init() },
executing: util.NewAtomicBool(false),
lastAction: actStart,
Expand Down Expand Up @@ -2736,7 +2738,7 @@ func (t *Terminal) executeCommand(template string, forcePlus bool, background bo
cmd.Env = t.environ()
t.executing.Set(true)
if !background {
cmd.Stdin = tui.TtyIn()
cmd.Stdin = t.ttyin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
t.tui.Pause(true)
Expand Down Expand Up @@ -3471,7 +3473,7 @@ func (t *Terminal) Loop() error {
if t.history != nil {
t.history.append(string(t.input))
}
t.executor.Become(tui.TtyIn(), t.environ(), command)
t.executor.Become(t.ttyin, t.environ(), command)
}
case actExecute, actExecuteSilent:
t.executeCommand(a.a, false, a.t == actExecuteSilent, false, false)
Expand Down

0 comments on commit 8a110e0

Please sign in to comment.