httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
33.56k stars 3.67k forks source link

Solarized dark theme in iTerm2, not printing correctly #1406

Open chunyang-wen opened 2 years ago

chunyang-wen commented 2 years ago

Checklist

A similar issue: https://github.com/httpie/httpie/issues/322

Minimal reproduction code and steps

image image
echo $TERM
xterm-256color
 http -m --follow --all pie.dev/redirect/3

Macos, iTerm2, Monetrey

Current result

image

Expected result

http -m --follow --all --style=solarized-dark pie.dev/redirect/3
image

Debug output

HTTPie 3.2.1
Requests 2.27.1
Pygments 2.10.0
Python 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:50:56)
[Clang 11.1.0 ]
/Users/chunyang/anaconda3/envs/py38/bin/python3.8
Darwin 21.5.0

<Environment {'apply_warnings_filter': <function Environment.apply_warnings_filter at 0x7fddc21aab80>,
 'args': Namespace(),
 'as_silent': <function Environment.as_silent at 0x7fddc21aaa60>,
 'colors': 256,
 'config': {'default_options': []},
 'config_dir': PosixPath('/Users/chunyang/.config/httpie'),
 'devnull': <property object at 0x7fddc213a270>,
 'is_windows': False,
 'log_error': <function Environment.log_error at 0x7fddc21aaaf0>,
 'program_name': 'http',
 'quiet': 0,
 'rich_console': <functools.cached_property object at 0x7fddc2107ca0>,
 'rich_error_console': <functools.cached_property object at 0x7fddc2128dc0>,
 'show_displays': True,
 'stderr': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'stderr_isatty': True,
 'stdin': <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>,
 'stdin_encoding': 'utf-8',
 'stdin_isatty': True,
 'stdout': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>,
 'stdout_encoding': 'utf-8',
 'stdout_isatty': True}>

<PluginManager {'adapters': [],
 'auth': [<class 'httpie.plugins.builtin.BasicAuthPlugin'>,
          <class 'httpie.plugins.builtin.DigestAuthPlugin'>,
          <class 'httpie.plugins.builtin.BearerAuthPlugin'>],
 'converters': [],
 'formatters': [<class 'httpie.output.formatters.headers.HeadersFormatter'>,
                <class 'httpie.output.formatters.json.JSONFormatter'>,
                <class 'httpie.output.formatters.xml.XMLFormatter'>,
                <class 'httpie.output.formatters.colors.ColorFormatter'>]}>

>>> requests.request(**{'auth': None,
 'data': RequestJSONDataDict(),
 'headers': <HTTPHeadersDict('User-Agent': b'HTTPie/3.2.1')>,
 'method': 'get',
 'params': <generator object MultiValueOrderedDict.items at 0x7fddc2701580>,
 'url': 'http://pie.dev/redirect/3'})

Elapsed time: 4.824123882s

Elapsed time: 5.004414695s

The last two lines does not behave correctly.

image

Additional information, screenshots, or code examples


Name: httpie
Version: 3.2.1
Summary: HTTPie: modern, user-friendly command-line HTTP client for the API era.
Home-page: https://httpie.io/
Author: Jakub Roztocil
Author-email: jakub@roztocil.co
License: BSD
Location: /path/to/anaconda3/envs/py38/lib/python3.8/site-packages
Requires: charset-normalizer, defusedxml, multidict, pip, Pygments, requests, requests-toolbelt, rich, setuptools
Required-by: