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

Piping through 'less' is problematic #1

Open
gsinclair opened this issue Jan 1, 2012 · 0 comments
Open

Piping through 'less' is problematic #1

gsinclair opened this issue Jan 1, 2012 · 0 comments
Labels

Comments

@gsinclair
Copy link
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
Labels
Projects
None yet
Development

No branches or pull requests

1 participant