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

Setting nullglob breaks color escaping. #9

Open
joeygravlin opened this issue Nov 17, 2017 · 0 comments
Open

Setting nullglob breaks color escaping. #9

joeygravlin opened this issue Nov 17, 2017 · 0 comments

Comments

@joeygravlin
Copy link

Apparently ANSI color escaping breaks when setting shopt -s nullglob. Not necessarily an issue with this codebase per se, in fact it's probably not an option most bash users should set unless they're really adamant about it. All the same, I figure others may run into the same issue I did, and so find this tidbit of information useful.

See: Why is nullglob not default? for why it's generally a bad idea to set this option in bash...

Another oddity I noticed: try running the following in an interactive shell.

echo -e $PR
DEBUG=1
echo -e $PR
DEBUG=0
shopt -s nullglob
shopt -s failglob
echo -e $PR
DEBUG=1
echo -e $PR

With only nullglob set, colors don't work, except for background jobs icon in prompt_status(). With both nullglob and failglob set, things are rather peculiar... A number of globs fail and no colors are in the prompt initially, but with DEBUG=1, prompt colors seem to work (mostly) and less globs fail. Also, the contents of $PR are not as you'd likely expect with DEBUG=1, when both {null,fail}glob are set vs just nullglob. I would spend more time on this if I had it right now. Might return with a pull-request, if I figure out a fix for this, after my semester settles down.

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

1 participant