--- rxvt-unicode/src/rxvtd.C 2007/12/14 02:22:24 1.43 +++ rxvt-unicode/src/rxvtd.C 2008/02/19 18:58:05 1.45 @@ -248,14 +248,16 @@ } } - chdir ("/"); - + // optionally open display and never release it. if (opt_opendisplay) - displays.get (getenv ("DISPLAY")); // open display and never release it + if (const char *dpy = getenv ("DISPLAY")) + displays.get (dpy ? dpy : ":0"); // move string logic into rxvt_display maybe? char *sockname = rxvt_connection::unix_sockname (); unix_listener l (sockname); + chdir ("/"); + if (!opt_quiet) { printf ("rxvt-unicode daemon listening on %s.\n", sockname);