Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bashdb evaluates escape codes when it's printing the current line of source code #32

Open
jansorg opened this issue Jul 4, 2024 · 1 comment

Comments

@jansorg
Copy link
Collaborator

jansorg commented Jul 4, 2024

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!"
@rocky
Copy link
Collaborator

rocky commented Jul 4, 2024

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.

Ok. Give me some time to look over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants