[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MIT-Scheme-devel] Running interactive subprocess
From: |
Taylor R Campbell |
Subject: |
Re: [MIT-Scheme-devel] Running interactive subprocess |
Date: |
Mon, 2 May 2011 23:34:18 +0000 |
User-agent: |
IMAIL/1.21; Edwin/3.116; MIT-Scheme/9.1 |
Date: Mon, 02 May 2011 20:13:17 -0300
From: "Diogo F. S. Ramos" <address@hidden>
I am trying to run an interactive subprocess but I'm having troubles
communicating with it.
The subprocess in question is mplayer, which accepts single keystrokes.
I've played with the (run-shell-command) options but I can't get it to
correctly send the chars to the subprocess.
You probably want to use the lower-level (undocumented) subprocess
support -- RUN-SHELL-COMMAND and RUN-SYNCHRONOUS-SUBPROCESS always
create pipes or a pty for the subprocess's standard input, output, and
error, and run it in a new session; the subprocess never sees Scheme's
controlling terminal directly.
Try
(run-subprocess-in-foreground
"/path/to/mplayer"
'#("mplayer" "--whatever" "--arguments" "--you" "want")
'#("environment=variables" "set=like so"))
This will return a subprocess object once the subprocess's status
changes -- either when the subprocess exits normally, terminates on a
signal, or stops. You can use SUBPROCESS-STATUS to find its status,
and SUBPROCESS-EXIT-REASON to find its exit value, if it exited
normally; the number of the signal that caused it to terminate; or the
number of the signal that caused it to stop.
If that doesn't work, show your code -- specify exactly what you
typed, exactly what you saw, and exactly what you expected to see.