Skip to content

Commit b31498d

Browse files
Reverse colors on win32 also when fgcolor/bgcolor have not been specified.
1 parent ff0f2c3 commit b31498d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

prompt_toolkit/terminal/win32_output.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ def set_attributes(self, attrs):
201201
if reverse:
202202
fgcolor, bgcolor = bgcolor, fgcolor
203203

204+
# Make sure to reverse, even when no values were specified.
205+
if fgcolor is None:
206+
fgcolor = '000000'
207+
if bgcolor is None:
208+
bgcolor = 'ffffff'
209+
204210
i = self.color_lookup_table.lookup_color(fgcolor, bgcolor)
205211
self._winapi(windll.kernel32.SetConsoleTextAttribute, self.hconsole, i)
206212

0 commit comments

Comments
 (0)