Disclaimer: I am not very familiar with the blessed code base, so there may be a more natural way to do this. If this does not happen, then this function should be requested / implemented.
Observation 1 - The color settings of your terminal affect the problem
Based on the screenshot you have indicated, the colors of your terminal default to black in front of a white background. If you invert this in your terminal settings, you can see the expected behavior.
But! Your application should not matter which user settings, so this is not a good solution ...
Observation 2 - Prompt constructor makes hard codes for children with a black background
If in doubt, go to the source ! Here is the part of prompt.js as of 2017-09-30:
// ... function Prompt(options) { // ... Box.call(this, options); this._.input = new Textbox({ // ... bg: 'black' }); this._.okay = new Button({ // ... bg: 'black', hoverBg: 'blue', }); this._.cancel = new Button({ // ... bg: 'black', hoverBg: 'blue', }); } // ...
So, it seems that the only way to fix your problem is to overwrite these children style properties after creating Prompt .
Solution 1 - Overwrite child style properties after creation
After creating the query, you can overwrite the style of each child. Probably the easiest way is to make the foreground white (as it should be) ...
In addition, for ease of maintenance, this hack really should be in its own function.
function createBlessedPrompt(options) { var prompt = blessed.prompt(options); // NOTE - Not sure if blessed has some sortof `children()` selector. // If not, we probably should create one. // Nevertheless, temporarily hardcoding the children here... // var promptChildren = [prompt._.input, prompt._.okay, prompt._.cancel]; promptChildren.forEach(x => { Object.assign(x.style, { fg: 'white', bg: 'black' }); }); return prompt; }
Solution 2 - Send the bug fix to the blissful repository
It really looks like a bliss problem. If you can think about how Prompt should properly handle this case, you should fully help your colleague and write a problem / pull request that fixes this.
Good luck