|
From: Petr M. <mi...@ph...> - 2003-10-29 10:08:17
|
> So now we have a problem: octave scripts only work with the call > to setvbuf(), while awk scripts only work without it. Octave is likely the > more important application, and anyway people have been using the > setvbuf() version for almost 2 years now. So we should leave the > default the way it is. I.e., there are some applications which call setvbuf(gp,NULL,_IOLBF,0); or do fflush(gp) after each command, and those which don't. Fortunately, interactive programs should not be affected unless they "set mouse" explicitly. However, this applies only to X11 terminal. I think it would be worth to add some text about the necessity of using setvbuf(f,NULL,_IOLBF,0); /* set unbuffered output */ into "help x11_mouse". > However, in case someone does want to use an awk script, > perhaps there could be an option > set mouse [no]buffered > The default would be nobuffered, implemented by the existing call > to setvbuf(). Specifying 'set mouse buffered' instead would bypass > the call to setvbuf() and allow awk to work. > > Would that be an acceptable work-around? Isn't this just X11 specific? Does it set both stdin/stdout to application and to terminal to non-buffer, or only for one end? Maybe, in the next fool-proof reincarnation of X11 terminal, it would be worth to do it like in gnuplot for OS/2 -- named pipe terminal->gnuplot, with gnuplot having a thread waiting for pipe events (or semaphores + shared memory). --- Petr Mikulik |