-
Notifications
You must be signed in to change notification settings - Fork 5
feat!: termlink v2 #8
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
Merged
Merged
Conversation
This file contains hidden or 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
Most terminals support the basic colors anyways, also when ColorLink is used to print hyperlinks, it also assumes colors are also present.
I might have brought this a bit too far
clear colors upon call to delete pre-existing values and use an escape code to reset links
blue color note text thingy
Closed
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 pull request makes the following changes:
Hyperlink detection
TERM_PROGRAM
variable checking is stricter now, with the help ofTERM_PROGRAM_VERSION
constraints. This is a breaking changehasEnv
,checkAllEnvs
,matchesEnv
etc., have been addedVersion
.parseVersion
now returns this struct of three variables instead of three standalone variables calledmajor
,minor
, andpatch
os.Getenv()
has been replaced withos.LookupEnv()
FORCE_HYPERLINK
variable, and forces hyperlinks as long as the variable's value is any of[]string{"1", "true", "always", "enabled"}
COLORTERM
variableVTE_VERSION
Color Handling
colorsList
map now has integer values instead of stringsparseColor("reset")
has been replaced with an escape code to avoid additional processingDependencies
fatih/color
andjwalton/go-supportscolor
have both been removed from the project. Checking for color support is unnecessary because this package only requires checking for basic colors.fatih/color
wasn't used in the main termlink code anywaysassert
testing library, which is only used for testing purposes and has no effect on mainDocumentation
README.md
has been modified with more code snippets and examples for other utilities such asSupportsHyperlinks
andshouldForce
Examples
examples/start.go
has been improved with more examples and textsTests
fatih/color
package has been removedv2.1v1.3.1 or in a future version (TODO)