Skip to content

Commit

Permalink
on branch osx-term, #256
Browse files Browse the repository at this point in the history
* Shoes.terminal works again but still oddly compared to -w launch
  No gain for branch. Boo for online Apple doc.
* -h or -g list -l don't display results so thats not good. Suggests the
  Gui (a window) needs to be on screen for Notication Center to work.
  • Loading branch information
Cecil committed Jun 19, 2016
1 parent 4dc76ba commit c940873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions shoes/console/cocoa-term.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
NSTextContainer *termContainer;
//NSTextView *termView;
DisplayView *termView;
NSFileHandle *outReadHandle;
// Stderr
NSPipe *errPipe;
NSFileHandle *errReadHandle;
Expand Down
9 changes: 5 additions & 4 deletions shoes/console/cocoa-term.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ - (void) setSink
{
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(stdOutDataSink:)
name: @"ShoesStdoutSink"
name: NSFileHandleDataAvailableNotification
object: outReadHandle];
[outReadHandle waitForDataInBackgroundAndNotify];}

- (void) removeSink
{
[[NSNotificationCenter defaultCenter] removeObserver: self
name: @"ShoesStdoutSink"
name: NSFileHandleDataAvailableNotification
object: outReadHandle];
}

Expand Down Expand Up @@ -316,12 +316,13 @@ - (void)consoleInitWithFont: (NSFont *)font app_dir: (char *)app_dir
}
// Replace the bridge's sink observer with one that puts the chars on the
// new window
outReadHandle = bridge->outReadHandle;
[bridge removeSink];
#if 1
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(stdOutDataAvail:)
name: @"ShoesStdout"
object: bridge->outReadHandle];
name: NSFileHandleDataAvailableNotification
object: outReadHandle];
[bridge->outReadHandle waitForDataInBackgroundAndNotify];
#else
[[NSNotificationCenter defaultCenter] addObserver: self
Expand Down

0 comments on commit c940873

Please sign in to comment.