I was trying to use GDB, and found that whenever it attempted to spawn the program I was debugging, Bash was spawned instead (GDB would say starting myProg..., and then Bash would appear. When I killed Bash, I'd be back in GDB, which would tell me Bash's exit status). At first I thought it was a bizarre problem with GDB, but then I discovered that trying to spawn a process from Vim also just spawned Bash.Through a weird flash of inspiration I connected this problem with the fact that my default shell is Tcsh, and as I'm not allowed to change it, I simply set my .tcshrc to contain exec bash. When I changed this to bash or just used Tcsh the problem disappeared.I have absolutely no insight into how the Tcsh thing leads to my problem. Could anyone provide any?As an aside, I was able to get a temporary fix running GDB by PATH= /usr/bin/gdb instead of just gdb. It spat out bash: command not found, and then proceeded to spawn the program I wanted to debug.
All subprocesses are Bash (!),
bash;shell;tcsh;exec
I think the reason is clearly that gdb uses a shell to spawn processes.Vim does it for sure (help !):!{cmd}         Execute {cmd} with the shell.So when we say :!ls -l Vim will execute in fact$ SHELL -c 'ls -l'I think (given I understood your hackish setup correctly) you can fix it easily by executing exec bash -l instead of exec bash.Reason being, exec bash (not being login shell) will not change the SHELL environment variable which is later on used by gdb and vim and points to your login shell (tcsh). They should use your shell of choice (bash) directly.NOTE: You might want to think what happens when you will be running some program written in tcsh. It will probably not behave as expected.