()
| 134 | } |
| 135 | |
| 136 | func (s *Shell) stop() { |
| 137 | if !s.Active() { |
| 138 | return |
| 139 | } |
| 140 | s.activeMutex.Lock() |
| 141 | s.active = false |
| 142 | s.activeMutex.Unlock() |
| 143 | close(s.haltChan) |
| 144 | } |
| 145 | |
| 146 | // Close stops the shell (if required) and closes the shell's input. |
| 147 | // This should be called when done with reading inputs. |