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

rich-cli needs a --force-terminal #3

Closed
willmcgugan opened this issue Jan 25, 2022 · 5 comments
Closed

rich-cli needs a --force-terminal #3

willmcgugan opened this issue Jan 25, 2022 · 5 comments
Assignees

Comments

@willmcgugan
Copy link
Collaborator

We will need a --force-terminal switch (plus single letter -f if its free) which forces terminal output. To allow users to pip to a file while allowing ansi codes (for pagers etc).

@henryiii
Copy link
Contributor

henryiii commented Feb 2, 2022

Did this get added? Don't see a linked PR. I tried | less and | head, and both remove the highlighting, which is why I'd use rich-cli in the first place - I can always cat or use NOCOLOR if I don't want highlighting. :)

Ahh, I see 12fed46, so I guess yes?

Also there are no tags or GH releases, so it's hard to see what's released and what's just in main. Could I also request a --version flag so I can tell what I'm running? :)

@henryiii
Copy link
Contributor

henryiii commented Feb 2, 2022

Ah, pip cache purge let me get the new version, it seems --force-terminal has even been released. Would love a version flag. ;)

head and tail work with --force-terminal (though less and more don't, for some reason I thought they supported escape sequences)

Ouch! Not only does -h not give help like most apps, but now it's taken as a shortcut to --head instead of --help. I'm sad.

@darrenburns
Copy link
Member

@henryiii You'll need to use less -r when piping to less to tell it to interpret the sequences.

@henryiii
Copy link
Contributor

henryiii commented Feb 3, 2022

Fantastic, thanks! --pager helps, but it doesn't support / search (yet?), so using a pager that does can be useful.

@ernstki
Copy link

ernstki commented Feb 27, 2022

Fantastic, thanks! --pager helps, but it doesn't support / search (yet?), so using a pager that does can be useful.

See also.

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

No branches or pull requests

4 participants