Interrupt adds a function to handle keyboard interrupt (Ctrl-c). count is the number of consecutive times that Ctrl-c has been pressed. i.e. any input apart from Ctrl-c resets count to 0.
(f func(c *Context, count int, input string))
| 405 | // count is the number of consecutive times that Ctrl-c has been pressed. |
| 406 | // i.e. any input apart from Ctrl-c resets count to 0. |
| 407 | func (s *Shell) Interrupt(f func(c *Context, count int, input string)) { |
| 408 | s.interrupt = f |
| 409 | } |
| 410 | |
| 411 | // EOF adds a function to handle End of File input (Ctrl-d). |
| 412 | // This overrides the default behaviour which terminates the shell. |