-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Try to detect the current theme based on the terminal background color #2631
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.
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
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
Found the issue with the tests, I've made a termbg patch here: dalance/termbg#19 |
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
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! |
I'm basically just waiting until dalance/termbg#19 is merged, but the author doesn't seem very active anymore. |
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
I've updated the branch (now with |
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. |
Ok, I'll make a new PR then. EDIT: here it is: #2797 |
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 test
is failing at the moment, I'll try to figure out why but any help would be appreciated.