When I leave the Visual Studio Code terminal open for too long, it randomly closes. I can't reopen the terminal, so I have to open a new terminal, where I'm put back into my home directory and have to cd back into the directory that I was working in. I'm not sure what needs to be changed so this doesn't continue to happen.
I've tried changing Terminal>Integrated>Confirm on Exit to always, but that hasn't helped. I'm not sure what else might be causing this to happen.
The best solution that I've found is as follows:
Add the following to .bashrc:
source ~/.fix-term.bashrc
Then edit or create ~/.fix-term.bashrc with the following:
export TMOUT=0 > /dev/null 2>&1
readonly TMOUT > /dev/null 2>&1
gdb -ex 'call (int) unbind_variable("TMOUT")' --pid=$$ --batch > /dev/null 2>&1
export TMOUT=0 > /dev/null 2>&1
readonly TMOUT > /dev/null 2>&1
The script will need to run again to implement this. An easy way to have the script run is to log out and back in again.