Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Recursively debugging using "debug" doesn't preserve cli args

Ouverte
#71 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
55/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Calme
Stack technique
bash
Domaine
cli

Piste de recherche

Reproduce the issue with the provided git hook setup and the recursive "debug" command. Start by tracing how the recursive bashdb invocation is built, then verify that --tty /dev/tty and --tty_in /dev/tty are preserved so /tmp/otherscript enters the debugger instead of quitting.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Shell
Étoiles
98
Forks
13
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Trepan-Debuggers/bashdb

Toutes les issues de Trepan-Debuggers/bashdb

Issues similaires

Plus d'issues Shell/Bash

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.