Try to detect the current theme based on the terminal background color#2631
Closed
aykevl wants to merge 1 commit intosharkdp:masterfrom
Closed
Try to detect the current theme based on the terminal background color#2631aykevl wants to merge 1 commit intosharkdp:masterfrom
aykevl wants to merge 1 commit intosharkdp:masterfrom
Conversation
This uses the termbg crate, as discussed here: sharkdp#1746 Other than that, it uses the same logic as on macOS. This behavior should probably be extended to macOS too, for cases like a terminal with a light background while the system theme is dark (or vice versa). But I didn't want to accidentally break anything on macOS.
aykevl
added a commit
to aykevl/termbg
that referenced
this pull request
Jul 28, 2023
It doesn't make sense to try to set a terminal as a raw terminal if it isn't actually a terminal. Worse, this may break tests that assume they can simply provide a pipe to a subprocess and expect the terminal will be unchanged. See this PR, which needs this patch: sharkdp/bat#2631
aykevl
added a commit
to aykevl/termbg
that referenced
this pull request
Jul 28, 2023
It doesn't make sense to try to set a terminal as a raw terminal if it isn't actually a terminal. Worse, this may break tests that assume they can simply provide a pipe to a subprocess and expect the terminal will be unchanged. See this PR, which needs this patch: sharkdp/bat#2631
Author
|
Found the issue with the tests, I've made a termbg patch here: dalance/termbg#19 |
aykevl
added a commit
to aykevl/termbg
that referenced
this pull request
Jul 28, 2023
It doesn't make sense to try to set a terminal as a raw terminal if it isn't actually a terminal. Worse, this may break tests that assume they can simply provide a pipe to a subprocess and expect the terminal will be unchanged. See this PR, which needs this patch: sharkdp/bat#2631
Collaborator
|
I hope you don't mind me closing this for now? I like when the PR inbox is clean :) Of course feel free to reopen this if you resume work on it! |
Author
|
I'm basically just waiting until dalance/termbg#19 is merged, but the author doesn't seem very active anymore. |
aykevl
added a commit
to aykevl/termbg
that referenced
this pull request
Dec 5, 2023
It doesn't make sense to try to set a terminal as a raw terminal if it isn't actually a terminal. Worse, this may break tests that assume they can simply provide a pipe to a subprocess and expect the terminal will be unchanged. See this PR, which needs this patch: sharkdp/bat#2631
Author
|
I've updated the branch (now with |
Collaborator
|
I think that's a GitHub bug, you need to open a new pr after pushing stuff to a closed PR, unfortunately. I can't reopen it either. |
Author
|
Ok, I'll make a new PR then. EDIT: here it is: #2797 |
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
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 uses the termbg crate, as discussed here: #1746
Other than that, it uses the same logic as on macOS.
This behavior should probably be extended to macOS too, for cases like a terminal with a light background while the system theme is dark (or vice versa). But I didn't want to accidentally break anything on macOS.
This is my first Rust PR, so please be gentle 😄
I'm marking this a draft because
cargo testis failing at the moment, I'll try to figure out why but any help would be appreciated.