gsinclair/whitestone — Issue #1: Piping through 'less' is problematic
Author: gsinclair
Created: 2012-01-01 22:59:04+00:00
State: open

I've never seen this before, but it's very reproducible on my shiny new iMac in both Terminal and iTerm. Running **`whitestone | less -R`** in a project directory looks OK to start with, but any input you give `less` (e.g. Space, Down, even q) is not acted upon until you hit Enter. This is _not_ how `less` is supposed to behave! Clearly the control characters are having an effect.

I'll have to try it again with the latest code (not that I think there have been any changes) on Cygwin.

Interestingly, running **`whitestone > test.log; less test.log`** solves the problem. So if `less` has access to the whole file, there's no issue.

Having looked at the raw Whitestone output, I think there are a *lot* of ANSI codes. Sure, the colouring in Whitestone is pretty complicated, but I think the codes could be simplified a bit -- that's a job for Col. Also, each line ends with \e[0m, which I think is correct, but `git diff`, with its coloured output, only uses \e[m -- that is, no zero. Further research warranted.

Summary: I've only seen this happen on the Mac, but other software emits coloured text without causing `less` any problems, so there is certainly an issue here to be fixed.