ymattw / ydiff

View colored, incremental diff in workspace or from stdin with side by side and auto pager support
Other
873 stars 62 forks source link

Add --no-pager option to disable pager irrespective of -c / tty status. #60

Closed tonycpsu closed 7 years ago

tonycpsu commented 7 years ago

The current behavior of auto-detecting pager behavior is fine for most situations, but in the case where color is wanted but paging is not, the current command-line options are insufficient. Simplest fix is to add -n/--no-pager option to force display to stdout.

ymattw commented 7 years ago

Hi, thanks for your PR. Colored output is for human eyes, but turning off pager conflicts with the purpose. If your case is to save colored output to a file, -c always does the job. So could you explain a scenario to help me understand why you need an extra option?

tonycpsu commented 7 years ago

My use case is capturing cdiff output in a Jupyter notebook, and I was having an issue where I thought the notebook process was hanging while cdiff waited for input from the pager from stdin.

But now that I look at it again, -c always does seem to do the right thing, so there must have been something else wrong with the way I was calling the process.

tl;dr: you're right, there's no need for this option. Sorry about that!