Skip to content

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

@jansorg

Description

@jansorg

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!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions