[sclug] less not cooperating

Will Dickson wrd at glaurung.demon.co.uk
Sat Jul 28 09:21:32 UTC 2007

Hi all,

Thanks to ed and Bob Dunlop for their suggestions.

@ed: I tried your suggestion (an explicit --window) but no luck.

@Bob: "The code fragment where you envoke less might have yielded some
interesting clues."

I tried various methods - blundering around naively and seeing what 
happened pretty much sums it up.

 From clues I've gleaned since, and suggestions I've been given here, I 
think the situation is that less can tell, even when it's operating in 
some kinds of pipeline, if it's really writing to a terminal device, and 
behaves accordingly. However, the Java process-control abstraction is 
breaking that link, so that less can only see stdin, stdout and stderr; 
3 streams without special characteristics. In this case, it does the 
best it can, which is to behave like cat.

Therefore, I'm either going to need native (ie. non-java) code, or a 
crude version of more in java. I think I'll go with the latter for now, 
and maybe do the former when time permits.


More information about the Sclug mailing list