Skip to content
Myr

Fix deadlock on exit

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 4c06da8 · Browse files · 1 file+11 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−1 removed

  • other:+11 added−1 removed

1 file+11 added−1 removed

modified:src/terminal.go+11 added-1 removed
131 unmodified lines
132 pwindow tui.Window133 count int134 progress int135 reading bool136 running bool137 failed *string138 jumping jumpMode139 jumpLabels string140 printer func(string)
364 unmodified lines
505 header0: header,506 ansi: opts.Ansi,507 tabstop: opts.Tabstop,508 reading: true,509 running: true,510 failed: nil,511 jumping: jumpDisabled,512 jumpLabels: opts.JumpLabels,513 printer: opts.Printer,
1330 unmodified lines
1844 t.history.append(string(t.input))1845 }1846 // prof.Stop()1847 t.killPreview(code)1848 t.running = false1849 t.mutex.Unlock()1850}18511852// Loop is called to start Terminal I/O1853func (t *Terminal) Loop() {
217 unmodified lines
20712072 go func() {2073 var focusedIndex int32 = minItem.Index()2074 var version int64 = -12071 for {2075 running := true2076 for running {2077 t.reqBox.Wait(func(events *util.Events) {2078 defer events.Clear()2079 t.mutex.Lock()2080 if !t.running {2081 running = false2082 t.mutex.Unlock()2083 return2084 }2085 for req, value := range *events {2086 switch req {2087 case reqPrompt:2088 t.printPrompt()
649 unmodified lines