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

Disable word-wrapping when output is not a terminal #37

Merged
merged 1 commit into from
Feb 24, 2019

Conversation

Gravemind
Copy link
Contributor

nvidia-settings seems to always word-wrap the output depending on the current terminal width. It's quite annoying when trying to redirect/pipe nvidia-settings' output for simple record keeping/diffing, simple task automation etc...

This PR shows a quick way to disable word-wrapping of nv_msg/nv_*_msg functions when the output stream is not a terminal (not isatty).

Issue:

When redirecting nvidia-settings output to a file or a pipe (for simple
recording, or scripting purposes), we don't want the output to change
depending on the current terminal width (TIOCGWINSZ).

Fix/Feature:

This change disables word-wrapping of `nv_msg`/`nv_*_msg` functions when
the output stream is not a terminal (not `isatty`).

PRE-Merge Build Fix from Liam Middlebrook <lmiddlebrook@nvidia.com>:
    Add _GNU_SOURCE define for fileno
@liam-middlebrook
Copy link
Contributor

Thanks for the contribution!

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.

2 participants