Skip to content

Commit 536eda9

Browse files
authored
Merge branch 'stable' into fishy_gdb
2 parents a09ef5e + 6007248 commit 536eda9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ The table below shows which release corresponds to each branch, and what date th
132132

133133
## 4.12.1
134134

135+
- [#2373][2373] Fix displaying bright color variation in terminal output
135136
- [#2378][2378] Don't go though a shell in `gdb.debug`
136137

138+
[2373]: https://github.com/Gallopsled/pwntools/pull/2373
137139
[2378]: https://github.com/Gallopsled/pwntools/pull/2378
138140

139141
## 4.12.0 (`stable`)

pwnlib/term/text.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ class Module(types.ModuleType):
2727
def __init__(self):
2828
self.__file__ = __file__
2929
self.__name__ = __name__
30-
self.num_colors = 8
31-
self.has_bright = self.num_colors >= 16
32-
self.has_gray = self.has_bright
30+
self.num_colors = termcap.get('colors', 8) if sys.platform == 'win32' else 8
3331
self.when = 'auto'
3432
self._colors = {
3533
'black': 0,
@@ -61,6 +59,14 @@ def when(self):
6159
def when(self, val):
6260
self._when = eval_when(val)
6361

62+
@property
63+
def has_bright(self):
64+
return self.num_colors >= 16
65+
66+
@property
67+
def has_gray(self):
68+
return self.has_bright
69+
6470
def _fg_color(self, c):
6571
c = termcap.get('setaf', c) or termcap.get('setf', c)
6672
if not hasattr(c, 'encode'):

0 commit comments

Comments
 (0)