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

Provide automatic display options that consider terminal width, etc. #693

Open
olson-sean-k opened this issue Apr 5, 2024 · 0 comments
Open

Comments

@olson-sean-k
Copy link

difft provides several --display modes that configure how output is formatted and written to stdout. As of version 0.57.0, these essentially boil down to presenting diffs in either one or two columns, typically requiring less or more horizontal space, respectively. Terminal width can vary a lot in different environments though (terminal sessions, multiplexor windows, etc.), and sometimes the desired --display mode isn't ideal at a particular width. I think providing automatic display modes that can choose between modes based on terminal width (or even other variables) would be great.

I think a straightforward approach to this may be to introduce an auto option for --display and accompanying options to specify the narrow vs. wide width threshold, the narrow display mode, and the wide display mode (e.g., --display-auto-width, --display-auto-narrow, and --display-auto-wide or some such). This could of course be more sophisticated though and, for example, consider the maximum width of the text too. Features like that may also make configuration a bit unwieldy for command line arguments.

Thanks for taking a look and for difft. 😄 Thoughts?

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

1 participant