I use TIOCSCTTY to forcibly take over the controlling terminal in other "remote" application. But after the application finishes running, controlling terminal gets orphaned and bash stops reacting to Ctrl+C until I restart it with bash$ exec bash.
How should I explicitly return the controlling terminal back after taking it with TIOCSCTTY?