Ok, now that you start to define the problem you want to solve, we can get closer to finding the right solution for it.
The most seamless way then would be to have a JACK server running in the background all the time, forwarding data from input to the output, and a script for the button launching and stopping the
sudo jack_capture to capture the stream to a new file each time it is activated.
This is because the button scripts are executed by
pisound-btn which is running as a background process. Ctrl+C only affects programs launched by you in the current terminal session. The button scripts themselves should launch software to be run in background, so the execution control is returned to the
pisound-btn process. This is usually achieved by having a ‘&’ symbol at the end of very last command in the button script.