Results 1 to 2 of 2

Thread: less and key-navigation fails when input is pipe

  1. #1
    Join Date
    Feb 2007
    Beans
    78

    less and key-navigation fails when input is pipe

    I am finding that keyboard arrows are failing to navigate when the input is piped to it. For example:
    Code:
    php script.php | less
    when the arrow keys are pressed you get ^[OB or ^[OA. When you pipe to log file and then use less on that the arrow keys work fine
    Code:
    php script.php > temp.txt
    less temp.txt
    Any ideas how I can overcome this? This us using Ubuntu 10.04 LTS and from an SSH session coming in from a mac. I tried SSHing into another server and this problem was not present. There is no difference in .inputrc file.

  2. #2
    Join Date
    Jun 2005
    Beans
    30

    Re: less and key-navigation fails when input is pipe

    I have the same, very irritating problem. However, it seems specifically tied to output from the PHP binary, which sets the terminal to line mode before the pipe. See:

    http://stackoverflow.com/questions/5...-a-cli-php-scr
    Last edited by Tolaris; April 16th, 2012 at 03:54 PM. Reason: Was wrong in first post.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •