script-server
script-server copied to clipboard
[HELP] How do I send "ctrl+c" through terminal input?
I have "requires terminal" enabled. I want to send what would be keystrokes of "ctrl+c" so the script I'm running isn't abruptly ended without properly finishing its process. As I'm having it download a live stream, and stopping and saving it before it naturally ends.
Hi @phere-x , did you try using stop button on UI? It should have very similar behavior for 98% of the cases It sends sigterm signal, which a process can intercept and finish gracefully
Hi I did try using the stop button but it just kills the bash script I'm triggering entirely. For further context I used YT-DLP & FFmpeg which downloads a stream in segments/parts & combines them together if the livestream ends or is halted by pressing Ctrl+C
I see, thanks. It seems, that youtube_dl doesn't recognize SIGTERM and only recognizes SIGINT (or just ctrl+C). I guess script-server needs a way to override which signal is sent to a script on stop.
Seems like the cleanest option would be a toggle in the script configuration, to "Send SIGINT instead of SIGTERM on stop"
On Tue, Oct 17, 2023 at 6:10 AM Iaroslav Shepilov @.***> wrote:
I see, thanks. It seems, that youtube_dl doesn't recognize SIGTERM and only recognizes SIGINT (or just ctrl+C). I guess script-server needs a way to override which signal is sent to a script on stop.
— Reply to this email directly, view it on GitHub https://github.com/bugy/script-server/issues/705#issuecomment-1766099389, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3HBI3UKCKY6YXQVHL6ILILX7ZKQPAVCNFSM6AAAAAA6AZ2SPGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRWGA4TSMZYHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>