File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,20 @@ int main(int argc, char **argv)
2727 return -1 ;
2828 }
2929
30+ CFDictionaryRef session = CGSessionCopyCurrentDictionary ();
31+ if (!session)
32+ fprintf (stderr,
33+ " Warning: %s is not running within a Quartz GUI session,\n "
34+ " so it won't be able to retrieve information on any windows.\n "
35+ " \n "
36+ " If you're using continuous integration, consider launching\n "
37+ " your agent as a GUI process (an `.app` bundle started via\n "
38+ " System Preferences > Users & Group > Login Items)\n "
39+ " instead of using a LaunchDaemon or LaunchAgent." ,
40+ argv[0 ]);
41+ else
42+ CFRelease (session);
43+
3044 NSString *requestedApp = @(argv[1 ]);
3145 NSString *requestedWindow = @(argv[2 ]);
3246 bool showList = [requestedWindow isEqualToString: @" --list" ];
You can’t perform that action at this time.
0 commit comments