diff --git a/src/Commands/TopCommand.php b/src/Commands/TopCommand.php index d7a9d80..c21765e 100644 --- a/src/Commands/TopCommand.php +++ b/src/Commands/TopCommand.php @@ -28,11 +28,11 @@ public function handle(GuiBuilder $guiBuilder): void Loop::addPeriodicTimer(0.5, fn () => $guiBuilder->moveToTop()->render()); Loop::addPeriodicTimer(1, fn () => $this->feed($guiBuilder)); - pcntl_signal(SIGINT, function () use ($guiBuilder) { + $this->trap(SIGINT, function () use ($guiBuilder) { $guiBuilder ->exitAlternateScreen() ->showCursor(); - exit(0); + exit(); }); }