Re: GNU readline / tty related questions



In article <1180103675.094305.230600@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
emiller_news@xxxxxxxxx wrote:

Hi,
I have to control a tool "A", that uses the GNU readline library for
it's command line, 'remotely' from another process "B". Currently I
send commands to and receive the output from the tool "A" via pipes.

The problem is that for example sending a <Tab> from "B" to "A"
doesn't start Tab-Completion and <Cursor-Up> doesn't read from the
history.

The readline library probably only processes control characters
specially when its input is a tty, not a pipe.


How can I have every key, that is typed in "B", sent to "A" so that it
is immediately interpreted as if it was typed in "A"s command line?

A problem that is probably related to this question is that, when
starting "A" via "execl(".../tool",...)" inside "B", the tool "A"
recognizes by calling isatty(), that it is not connected to a
terminal. Can I attach it to a tty before or after "execl()"? If not,
another option is to start "A" first on a terminal, if I can later
grab/send to that terminal from the control process "B" as mentioned
above.

Any clues how to do this?

Use a pseudo-tty (pty) rather than a pipe. You might want to make use
of Expect, a scripting language specifically designed for controlling
interactive programs.

--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.



Relevant Pages

  • Re: Access 2007 Technical Questions
    ... you may want to bypass the validation rules such as user clicking on the ... on the form, all validation rules on the active control are processed, ... Enter Event doesn't even take place on the command button cause the ... If you used either of these, there would be no reason to check ...
    (microsoft.public.access.formscoding)
  • Re: Word 2007 -- How Alone Am I?
    ... One more question -- when I open the directory in Word (control O), ... QAT are assigned a Key Tip by the position of the command. ... click the Microsoft Office Button and then click New. ... and then click "Add to Quick Access Toolbar". ...
    (microsoft.public.office.misc)
  • Re: Required reading for HP executives
    ... the other 2 will still control ... harware in it to decide which command has majority when it gets multiple ... The mid tier is the "server side" management ... Each MDM ...
    (comp.os.vms)
  • Re: Suggestions for X10/Automation Widgets
    ... X-Lock" by Jeff Mazur that was along the lines of what The Alien is ... It listened to the powerline and, when it heard an alien X-10 ... command, jammed it by corrupting the signal. ... You need physical control of a device to enroll ...
    (comp.home.automation)
  • Re: CreateControl command Crashes Access
    ... detailed form with lots of command buttons being created in code. ... disables all the command buttons and then re-enables only ... the same button then becomes a Back to Inspection ... 'set control to be disabled and set tooltip ...
    (microsoft.public.access.formscoding)