diff options
-rw-r--r-- | src/lib9/getns.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib9/getns.c b/src/lib9/getns.c index 6c221eed..2421a649 100644 --- a/src/lib9/getns.c +++ b/src/lib9/getns.c @@ -29,8 +29,15 @@ nsfromdisplay(void) char *disp, *p; if((disp = getenv("DISPLAY")) == nil){ +#ifdef __APPLE__ + // Might be running native GUI on OS X. + disp = strdup(":0.0"); + if(disp == nil) + return nil; +#else werrstr("$DISPLAY not set"); return nil; +#endif } /* canonicalize: xxx:0.0 => xxx:0 */ |