Trepan-Debuggers / Trepan-Debuggers/bashdb
bashdb evaluates escape codes when it's printing the current line of source code
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 98
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Debugging the snippet yields this (in red color):
(/home/jansorg/test.bash:2):
2: RED=$''
bashdb<0>
But it should have printed the source line unchanged, i.e. as RED=$'\x1b[31m'.
I tried to fix this, but couldn't find the place where the source line is printed (in lib/hooks.sh?).
If you pointed me to the right source, I'd try again to fix this.
#!/bin/bash
RED=$'\x1b[31m'
RESET=$'\x1b[0m'
read -e -p "Please enter a name: " -r NAME
echo "The name is $RED$NAME$RESET!"
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example script and trace where bashdb prints the current source line, checking lib/hooks.sh as suggested in the issue. The fix is complete when escape sequences in a line such as RED=$'\x1b[31m' are displayed unchanged rather than evaluated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100