bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about terminal mode after fork and before exec


From: Thomas Dickey
Subject: Re: question about terminal mode after fork and before exec
Date: Fri, 22 Nov 2002 16:52:49 -0500
User-agent: Mutt/1.3.27i

On Fri, Nov 22, 2002 at 04:37:50PM -0500, Lucas Gonze wrote:
> On Fri, 22 Nov 2002, Thomas Dickey wrote:
> > > An example of the output text is:
> > >         ^MESC[38BESC[1m> execvp: No such file or directory^MESC[m
> > 
> > actually the escape sequences look as if they're coming from your shell 
> > prompt.
> 
> interesting answer.  Are you saying that those specific escape codes are
> more like prompt escapes than CUI escapes?  hm, hm, hm, hm.

more-like (I was looking at the "ESC[1m>" part.
 
Back to the issue though.  If you fork a process, the two halves aren't
going to write synchronously to the terminal.  You can cut down on the
problem a little by doing fflush(stdout) and fflush(stderr) before the
fork, but that'll still leave the stuff from stderr coming to your screen
and making it hard to read.

(The fflush's would help keep the escape sequences from interfering though).

> My code isn't invoking the shell -- it's calling execvp to launch an
> executable that isn't there -- so there would have to be an unexpected
> interaction between my program and its parent shell.
> 
> ....
> 
> 

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]