Currently, when the script is interrupted using Ctrl+C, it raises a KeyboardInterrupt exception, which may cause the script to freeze or terminate unexpectedly, leaving the user without guidance on how to properly exit. This can be especially problematic if the script is running in a terminal, as the only option might be to kill the terminal session entirely.
To improve the user experience, I propose adding a handler for the KeyboardInterrupt exception that provides a clear message on how to exit the script properly.
Steps to Reproduce
Run the script.
Press Ctrl+C to interrupt the script.
Observe the raised KeyboardInterrupt exception and the script's behavior.
Expected Behavior
When Ctrl+C is pressed, the script should catch the KeyboardInterrupt exception and display a message instructing the user on how to exit the script properly.
Currently, when the script is interrupted using Ctrl+C, it raises a KeyboardInterrupt exception, which may cause the script to freeze or terminate unexpectedly, leaving the user without guidance on how to properly exit. This can be especially problematic if the script is running in a terminal, as the only option might be to kill the terminal session entirely.
To improve the user experience, I propose adding a handler for the KeyboardInterrupt exception that provides a clear message on how to exit the script properly.
Steps to Reproduce Run the script. Press Ctrl+C to interrupt the script. Observe the raised KeyboardInterrupt exception and the script's behavior. Expected Behavior When Ctrl+C is pressed, the script should catch the KeyboardInterrupt exception and display a message instructing the user on how to exit the script properly.![Screenshot 2024-06-20 180254](https://github.com/pieces-app/cli-agent/assets/107706485/6823042f-f333-47f2-91cc-23d6e905293c)