We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6967e04 commit 0d6f7e5Copy full SHA for 0d6f7e5
src/Stdin.php
@@ -32,6 +32,10 @@ public function __construct(LoopInterface $loop)
32
// Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead)
33
shell_exec('stty -icanon -echo');
34
}
35
+
36
+ // register shutdown function to restore TTY mode in case of unclean shutdown (uncaught exception)
37
+ // this will not trigger on SIGKILL etc., but the terminal should take care of this
38
+ register_shutdown_function(array($this, 'close'));
39
40
41
public function close()
0 commit comments