close input channel when receiving io.EOF
This commit is contained in:
parent
4748609611
commit
2d75a4537c
2 changed files with 1 additions and 9 deletions
|
@ -536,7 +536,6 @@ func generateInteractive(cmd *cobra.Command, model string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer scanner.Close()
|
||||
|
||||
var wordWrap bool
|
||||
termType := os.Getenv("TERM")
|
||||
|
|
|
@ -211,10 +211,6 @@ func (i *Instance) Readline() (string, error) {
|
|||
}
|
||||
}
|
||||
|
||||
func (i *Instance) Close() {
|
||||
i.Terminal.Close()
|
||||
}
|
||||
|
||||
func (i *Instance) HistoryEnable() {
|
||||
i.History.Enabled = true
|
||||
}
|
||||
|
@ -239,6 +235,7 @@ func (t *Terminal) ioloop() {
|
|||
for {
|
||||
r, _, err := buf.ReadRune()
|
||||
if err != nil {
|
||||
close(t.outchan)
|
||||
break
|
||||
}
|
||||
t.outchan <- r
|
||||
|
@ -253,7 +250,3 @@ func (t *Terminal) Read() (rune, error) {
|
|||
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (t *Terminal) Close() {
|
||||
close(t.outchan)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue