Skip to content
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

Add color support for the TUI #1350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kannibalox
Copy link
Contributor

This uses a subset of the rtorrent-ps color commands and logic to do coloring of the download list and header/footer, in both normal and collapsed view. Color strings work with the basic syntax of <fg attributes> <fg color> [on <bg attributes> <bg color>], with a faux-attribute of bright for 256-color enabled terminals.

Without any color
with a simple config of:

ui.color.title.set="bold bright white on blue"
ui.color.queued.set=blue
ui.color.leeching.set=green
ui.color.odd.set=dim
ui.color.focus.set=reverse
ui.color.footer.set="bold bright white on blue"

Expanded list
Compact list

Fails gracefully when the terminal doesn't support the specified color (note that attributes will still work), e.g.

$ TERM=xterm-old ./src/rtorrent -n -o ui.color.leeching.set=green
rtorrent: green: your terminal only supports 0 colors.

Works correctly in daemon mode, and adds a couple extra checks to avoid unneeded redraw()s

Closes #398

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

is the color patch still needed?
1 participant