When commands are run from the output pane, is there a good reason why you
use mkfifo on a file in /tmp rather than calling pipe(2). I've attached
a patch to change this. This seems much cleaner to me, it avoids any
concern of security race conditions and there's no chance of old temp
files getting left behind in /tmp.
In the Output pane, running ls -l /proc/self/fd shows that open files
such as the pipe for talking to scite are left open. My patch closes
them all. You may prefer to set them to be close on exec at the point
where they are opened. I also point stdin to /dev/null instead of the
pipe which I thing is cleaner. Also, note that you should use _exit()
instead of exit() in the forked process. I also wonder whether it would
be better to use dup2() to fill out stdin/out/err but am not sure that's
fully portable.
Any pointers to help me work out how to get the command.input,
command.replace and command.quiet working on GTK would be good. Note
that I don't have access to Windows to verify exactly how they
work there. Presumably, stderr gets sent to the output pane.
Sorry if this isn't the right place to send patches.
Thanks
Oliver
> When commands are run from the output pane, is there a good reason why you
> use mkfifo on a file in /tmp rather than calling pipe(2).
Its a while back and there were multiple contributors but I think
the main issue was portability. There are some platforms that support
GTK+ with incomplete POSIX compatibility and on these a temporary file
could be used rather than a fifo. I haven't received any OpenVMS
patches recently so I suspect that support has now rotted away. I'd
expect that cygwin users would use the native Windows SciTE but maybe
a cygwin/GTK+ version interacts better with cygwin tools.
It may be worth the potential cost of incompatibility so anyone
using OpenVMS or cygwin (or similar like QNX) should have a look at
this now.
Swapping the I/O redirection approach for a pty would allow better
interaction with subprocesses but again raises portability and
compatibility issues.
> Any pointers to help me work out how to get the command.input,
> command.replace and command.quiet working on GTK would be good. Note
> that I don't have access to Windows to verify exactly how they
> work there. Presumably, stderr gets sent to the output pane.
You can search the code for jobQuiet and repSelBuf.
> Sorry if this isn't the right place to send patches.
The feature request tracker is at
http://sourceforge.net/tracker/?group_id=2439&atid=352439
The benefit with the tracker is that other people can use your
patch and improve on it even if I don't like it. OTOH, you probably
still want to talk about it here as relatively few people are
subscribed to the tracker.
Neil
> When commands are run from the output pane, is there a good reason why you
> use mkfifo on a file in /tmp rather than calling pipe(2). I've attached
> a patch to change this.
I will commit this now although I think there is a some chance it
will break Cygwin or OpenVMS.
> One idea, if anyone interested in coding the C++ is still reading,
> would
> be to open two separate pipes for stdin and stderr. stdin and stderr
> could then be coloured differently and there could be options for
> hiding/showing one or the other, perhaps similar to the editor pane
> folding for lines that aren't mixed.
If you separate these out there is more chance of the two streams
being rendered out of order due to buffering.
If anyone is using OpenVMS or Cygwin could they please check the
current CVS code. It would also be useful to know if all the OpenVMS
code (#ifdef __vms) is still needed as I would expect OpenVMS to have
improved compatibility with Linux over time.
Neil