topheman / snake-pipe-rust

🦀 A snake game based on stdin/stdout (+tcp and unix sockets) in rust
MIT License
12 stars 1 forks source link

Correctly handle interrupt signal in pipelines #55

Closed topheman closed 5 months ago

topheman commented 7 months ago

The snakepipe gamestate command needs to crossterm::terminal::enable_raw_mode() in order to catch user inputs.

The Ctrl+C is handled manually:

The problem

When you launch a pipeline like:

snakepipe gamestate|snakepipe render-browser|snakepipe render

You need to hit Ctrl+C twice to exit.

This might be related to https://github.com/topheman/snake-pipe-rust/issues/25