In bash I spin up a t/csh shell, which updates the tty input (stty erase ^H) in the .cshrc, but when exit-ing and returning to bash the backspace key no longer works. This is because bash uses readline and I need to reset the erase (stty erase ^?).
If I understand trap correctly, it seems like I could trap the t/csh exit from within the t/csh process, and run commands after it exits. However, my preference would be for the trapping to occur in bash, which ideally would detect a shell was called/exited and then run a script to reset its configurations.
This is preferred because I could call any number of shells (e.g., dash, zsh), which may inadvertently modify bash-specific settings. Instead of maintaining multiple trap commands for each shell, it seems like it would be best to have one for bash.
Is my understanding of trap correct? If so, is it possible for bash to detect a child shell exit and then run a script?