Skip to content

Commit

Permalink
Merge branch 'beta' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Apr 21, 2024
2 parents f2f55f3 + 5f79e1d commit 27366fd
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The table below shows which release corresponds to each branch, and what date th
| ---------------- | -------- | ---------------------- |
| [4.14.0](#4140-dev) | `dev` |
| [4.13.0](#4130-beta) | `beta` |
| [4.12.1](#4121) | |
| [4.12.0](#4120-stable) | `stable` | Feb 22, 2024
| [4.11.1](#4111) | | Nov 14, 2023
| [4.11.0](#4110) | | Sep 15, 2023
Expand Down Expand Up @@ -148,6 +149,14 @@ The table below shows which release corresponds to each branch, and what date th
[2347]: https://github.com/Gallopsled/pwntools/pull/2347
[2233]: https://github.com/Gallopsled/pwntools/pull/2233

## 4.12.1

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

[2373]: https://github.com/Gallopsled/pwntools/pull/2373
[2378]: https://github.com/Gallopsled/pwntools/pull/2378

## 4.12.0 (`stable`)

- [#2202][2202] Fix `remote` and `listen` in sagemath
Expand Down
4 changes: 4 additions & 0 deletions pwnlib/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ def _gdbserver_args(pid=None, path=None, args=None, which=None, env=None, python
gdbserver_args += ['--wrapper', python_wrapper_script, '--']
elif env is not None:
gdbserver_args += ['--wrapper', which('env'), '-i'] + env_args + ['--']
# --no-startup-with-shell is required for forking shells like SHELL=/bin/fish
# https://github.com/Gallopsled/pwntools/issues/2377
else:
gdbserver_args += ['--no-startup-with-shell']

gdbserver_args += ['localhost:0']
gdbserver_args += args
Expand Down
12 changes: 9 additions & 3 deletions pwnlib/term/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ class Module(types.ModuleType):
def __init__(self):
self.__file__ = __file__
self.__name__ = __name__
self.num_colors = 8
self.has_bright = self.num_colors >= 16
self.has_gray = self.has_bright
self.num_colors = termcap.get('colors', 8) if sys.platform == 'win32' else 8
self.when = 'auto'
self._colors = {
'black': 0,
Expand Down Expand Up @@ -61,6 +59,14 @@ def when(self):
def when(self, val):
self._when = eval_when(val)

@property
def has_bright(self):
return self.num_colors >= 16

@property
def has_gray(self):
return self.has_bright

def _fg_color(self, c):
c = termcap.get('setaf', c) or termcap.get('setf', c)
if not hasattr(c, 'encode'):
Expand Down

0 comments on commit 27366fd

Please sign in to comment.