[racket] current-subprocess-custodian-mode
Greetings.
I think that current-subprocess-custodian-mode may have some error in its argument-checking.
If I evaluate the following in DrRacket:
(parameterize ((current-subprocess-custodian-mode #f))
(subprocess (current-output-port)
(current-input-port)
(current-error-port)
"/usr/bin/vi"
fn))
I get an error "current-subprocess-custodian-mode: expects argument of type <'interrupt, 'kill, or #f>; given: #f".
Either I'm grievously misreading that, or else something's being overprotective. A quick look around the collects/ tree doesn't turn up any .rkt code for this procedure, so I'm afraid I can't track it down further.
----
Now, some other experiments indicate that this won't do what I want anyway, since (current-*-port) aren't file-stream-port? ports.
What I _want_ to do here is basically execv(3) vi from a Racket program. I can't find such a thing, and the above is an attempt to see how far I could get using 'subprocess' (hoping the vi child would be left with the parent FDs still attached to the terminal, and letting the parent terminate), but the limitation to file-stream-port? suggests it's not intended for this, which doesn't astonish me. I can broadly see how a naive exec would cause trouble within a system like racket, but is this in fact unsupported? Or am I just missing it?
(the underlying motivation is that scsh appears to have entered a... quiescent phase, and it occurred to me to rewrite a couple of scsh scripts, that I depend on, in Racket).
Thanks for any pointers.
Best wishes,
Norman
--
Norman Gray : http://nxg.me.uk
SUPA School of Physics and Astronomy, University of Glasgow, UK