Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#71 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
bash
領域
cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Shell
スター
98
フォーク
13
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Trepan-Debuggers/bashdb のほかの issue

Trepan-Debuggers/bashdb の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。