Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Piping through 'less' is problematic #1

Open
gsinclair opened this Issue January 01, 2012 · 0 comments

1 participant

Gavin Sinclair
Gavin Sinclair
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.