I was debugging a bash script whose stdin and stdout were not my tty (a git hook, to be precise), and passed --tty /dev/tty --tty_in /dev/tty which worked great to be able to debug that initial script.
However, that script ran some other scripts, and attempting to recursively step into those with the default "debug" command didn't work because that sub-invocation of bashdb didn't preserve the --tty and --tty_in arguments.
To reproduce the problem:
# Create a minimal git repo
git init myrepo
cd myrepo
touch foo ; git add foo ; git commit -m foo foo
# Set up the hook scripts:
cat <<EOF > .git/hooks/post-checkout
bashdb --tty /dev/tty --tty_in /dev/tty /tmp/somescript
EOF
chmod +x .git/hooks/post-checkout
echo "/tmp/otherscript" > /tmp/somescript
echo "echo end of somescript" >> /tmp/somescript
echo "echo in otherscript" > /tmp/otherscript
echo "echo another line" >> /tmp/otherscript
chmod +x /tmp/*script
git checkout HEAD # Trigger the hook
Then enter debug on the /tmp/otherscript line, and notice that you don't end up debugging it, the inner bashdb immediately quits with "That's all, folks..."
I'm guessing that many of the other cli args should be preserved to sub-bashdb invocations as well.
I was debugging a bash script whose stdin and stdout were not my tty (a git hook, to be precise), and passed
--tty /dev/tty --tty_in /dev/ttywhich worked great to be able to debug that initial script.However, that script ran some other scripts, and attempting to recursively step into those with the default "debug" command didn't work because that sub-invocation of bashdb didn't preserve the
--ttyand--tty_inarguments.To reproduce the problem:
Then enter
debugon the/tmp/otherscriptline, and notice that you don't end up debugging it, the inner bashdb immediately quits with "That's all, folks..."I'm guessing that many of the other cli args should be preserved to sub-bashdb invocations as well.