You can exit the menu by pressing CTRL+C. But in that case the following code does not get called: protected function tearDownTerminal() : void { ... $this->terminal->enableCursor(); } And as a result, there's no cursor in the shell. How can I enable cursor if user presses CTRL+C?