New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: introduce color profiles and use term/ansi for styles #269
Open
aymanbagabas
wants to merge
12
commits into
master
Choose a base branch
from
use-ansi-style
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aymanbagabas
requested review from
maaslalani,
caarlos0,
meowgorithm and
muesli
and removed request for
meowgorithm,
muesli,
maaslalani and
caarlos0
March 15, 2024 02:04
aymanbagabas
force-pushed
the
use-ansi-style
branch
3 times, most recently
from
March 17, 2024 05:25
4266ed6
to
3f0320a
Compare
aymanbagabas
force-pushed
the
use-ansi-style
branch
2 times, most recently
from
March 22, 2024 15:45
715eb23
to
dcf74fd
Compare
aymanbagabas
force-pushed
the
use-ansi
branch
4 times, most recently
from
March 28, 2024 15:12
caab99b
to
e28ab39
Compare
aymanbagabas
force-pushed
the
use-ansi-style
branch
from
March 28, 2024 15:16
dcf74fd
to
d3d126d
Compare
aymanbagabas
force-pushed
the
use-ansi-style
branch
2 times, most recently
from
March 28, 2024 15:27
a5e85e1
to
9c98fb7
Compare
aymanbagabas
force-pushed
the
use-ansi-style
branch
from
April 23, 2024 15:24
bc4b597
to
a0d1478
Compare
caarlos0
approved these changes
Apr 24, 2024
Use ANSI aware, wide characters support, uniseg backed term/ansi package to calculate string widths, truncate, and wrap strings. Related: muesli/reflow#71 Fixes: #258 Fixes: #220
This introduces color profiles similar to Termenv color profiles. Plus, it switches to using Charmbracelet term & term/ansi to query terminal background color for the default renderer, and construct styles. However, it breaks the renderer API since it doesn't depend on Termenv anymore.
And export both EnvColorProfile and EnableLegacyWindowsANSI
The NoTTY profile generates no sequences while the Ascii profile generates sequences with no colors (bold, italic, underline, etc)
Replace Sequence with profile logic checks
aymanbagabas
force-pushed
the
use-ansi-style
branch
from
April 29, 2024 17:54
d6d7a2d
to
2791e00
Compare
aymanbagabas
force-pushed
the
use-ansi-style
branch
2 times, most recently
from
April 29, 2024 18:35
8b73e82
to
28bf0c1
Compare
aymanbagabas
force-pushed
the
use-ansi-style
branch
from
April 29, 2024 18:37
28bf0c1
to
ebf64f5
Compare
Nice! The latest changes fixed the Bubble Tea |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces color profiles similar to Termenv color profiles. Plus, it switches to using Charmbracelet term & term/ansi to query terminal background color for the default renderer, and construct styles.
However, it breaks the renderer API since it doesn't depend on Termenv anymore.
This also introduces a new color profile
NoTTY
. This profile doesn't generate any ANSI sequences, and, as the name suggests, is used when the renderer is dealing with a non-terminal output. TheAscii
profile on the other hand is used to generate all the style sequences except color ones. This works well whenNO_COLOR
.