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

how to colorize prompt? #171

Closed
timotheecour opened this issue Mar 26, 2017 · 2 comments
Closed

how to colorize prompt? #171

timotheecour opened this issue Mar 26, 2017 · 2 comments
Labels

Comments

@timotheecour
Copy link

timotheecour commented Mar 26, 2017

@TylerBrock

tried modifying code as follows:

var prompt_string = "PROMPT";
return colorize(prompt_string, mongo_hacker_config.colors.date);

but it prints escaped code as follows:
[34mPROMPT[m^C

@timotheecour
Copy link
Author

timotheecour commented Mar 26, 2017

related:

workaround: use print() :

    var prompt_string = host + '(' + process + '-' + version + ')' + state + ' ' + db;
    var prompt_string = colorize(prompt_string, mongo_hacker_config.colors.prompt);
    print(prompt_string);
    return ">";

@tukusejssirs
Copy link

@TylerBrock, this helped me a lot. Could this be noted somewhere like a FAQ or tutorials or even in the README.md?

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

No branches or pull requests

3 participants