gnustep-dev
[Top][All Lists]
Advanced

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

Re: why does NSTask setpgrp on sub processes?


From: David Chisnall
Subject: Re: why does NSTask setpgrp on sub processes?
Date: Wed, 20 Jan 2010 11:30:37 +0000

On 20 Jan 2010, at 09:48, Derek Zhou wrote:

#import <Foundation/Foundation.h>

int main(int argc, char** argv)
{
 NSTask* editor = [NSTask new];
 [editor setLaunchPath: @"vi"];
 [editor launch];
 [editor waitUntilExit];
 NSLog(@"finished\n");
}


I can confirm that, on OS X, once you've fixed it to specify the full path, this runs vi(m) in the foreground, lets you edit things, and then exits once vi has terminated. On FreeBSD/GNUstep, it displays nothing on the screen, then when you hit control-c terminates.

So, the current behaviour in GNUstep is incorrect, although I'm not sufficiently well versed with terminal behaviour to know how to implement the correct behaviour.

Having multiple processes reading from the terminal is not a problem, in general, because any program that runs a terminal program will sleep until the child has exited. With the current implementation it would not, for example, be possible to write a shell using GNUstep.

David

--
This email complies with ISO 3103





reply via email to

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