Reset works by sending kill(-9) to all children & then executing 'exit' so that all pipes gets closed & things start from scratch. Typing 'exit' will also reload things from scratch for the user. The code is put in error handling as well