Amir Tahvildaran on 19 Jul 2012 10:46:35 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] php pipe to less broken?


Not sure what's going on here.  On a CentOS 6.2 vm when I pipe php output to less I wind up in some weird mode where "j" and "k" don't move up and down, instead they just queue up at this colon prompt.

:jkjk

If I hit enter after it sort of goes up/down by a line.  If I hit gg or G and then enter I get to the top or bottom of the file.  Similarly 'q<enter>' get's me out of it.

Is anyone familiar with this mode of less?  Same thing happens for more.  Same thing happens if I throw tee in the middle (and I can less the tee'd file normally afterwards too). 

It seems to only be for PHP output, if I cat a file to less it works as expected.  If I write a bash script it also works as expected.  I tried getting php to exit(0) or exit(1).  The php script runs and exits as normal (AFAIK) without the pipe.

Any thoughts?

-Amir

$ php -version
PHP 5.3.3 (cli) (built: Jul  3 2012 16:40:30) 
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug