How to send UP arrow key to popen child - Unix

This is a discussion on How to send UP arrow key to popen child - Unix ; Hi, I am using popen(..., "w") to open a process and write the command to it. Originally the program can receive UP arrow/DOWN arrow key event, but I don't know how to send these keys through fwrite. Thanks in advance. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to send UP arrow key to popen child

  1. How to send UP arrow key to popen child

    Hi,

    I am using popen(..., "w") to open a process and write the command to
    it. Originally the program can receive UP arrow/DOWN arrow key event,
    but I don't know how to send these keys through fwrite.

    Thanks in advance.

    Bin

  2. Re: How to send UP arrow key to popen child

    Bin Chen wrote:
    > Hi,
    >
    > I am using popen(..., "w") to open a process and write the command to
    > it. Originally the program can receive UP arrow/DOWN arrow key event,
    > but I don't know how to send these keys through fwrite.
    >
    > Thanks in advance.
    >
    > Bin


    "\x1B[A" is the ANSI escape sequence that corresponds to the up arrow
    key, and "\x1B[B" is for down. I'm not completely sure that will work,
    though.

    --
    --Falcon Kirtaran

+ Reply to Thread