=================================================================== RCS file: /home/cvs/OpenXM/src/util/ox_pathfinder.c,v retrieving revision 1.16 retrieving revision 1.22 diff -u -p -r1.16 -r1.22 --- OpenXM/src/util/ox_pathfinder.c 2003/12/04 06:29:21 1.16 +++ OpenXM/src/util/ox_pathfinder.c 2004/03/03 08:21:30 1.22 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/util/ox_pathfinder.c,v 1.15 2003/12/04 05:27:19 takayama Exp $ */ +/* $OpenXM: OpenXM/src/util/ox_pathfinder.c,v 1.21 2004/03/03 02:31:51 takayama Exp $ */ /* Moved from misc-2003/07/cygwin/test.c */ #include @@ -35,6 +35,7 @@ static void msgPathFinder(char *s); static int Verbose_get_home = 0; +static int Verbose = 1; static int NoX = 0; @@ -62,7 +63,7 @@ int ox_pathfinderVerbose(int f) { if (f < 0) return Verbose_get_home; Verbose_get_home = f; return f; -} +} /* cf. ox_pathfinder_quiet() */ /* test main */ /* @@ -117,7 +118,7 @@ static void myforkwait() { int i,j; /* signal(SIGCHLD,SIG_IGN); It is not allowed in posix */ pid = wait(&status); - fprintf(stderr,"Child process %d is exiting.\n",pid); + if (Verbose) fprintf(stderr,"Child process %d is exiting.\n",pid); if (pid < 0) { perror("wait"); } @@ -576,7 +577,9 @@ char **getServerEnv(char *oxServer) { int ostype; char *p; char *oxhome; - char *xterm; + char *oxterm; + int oxtermType=0; + char *oxtermOpt; char *oxlog; char *load_sm1_path; char *load_k0_path; @@ -619,20 +622,25 @@ char **getServerEnv(char *oxServer) { strcpy(oxServer,p); if ((ostype == 0) || (ostype == 2)) { - if (!NoX) { - xterm = "/usr/X11R6/bin/xterm"; - if (getFileSize(xterm) == -1) { - msg_get_home(2,"xterm is not found. NoX is automatically set."); - NoX = 1; - } - } oxlog = get_oxlog_path(); - xterm = "/usr/X11R6/bin/xterm -icon -e "; + if (!NoX) { + oxterm = oxTermWhich_unix(&oxtermType); + if (oxterm == NULL) { + msg_get_home(2,"oxterm, rxvt, xterm is not found. NoX is automatically set."); + NoX = 1; + } + if (oxtermType == T_XTERM) oxtermOpt = "-icon"; + else oxtermOpt = "-iconic"; + } argv[i] = oxlog; i++; argv[i] = NULL; if (!NoX) { - argv[i] = "/usr/X11R6/bin/xterm"; i++; argv[i] = NULL; - argv[i] = "-icon"; i++; argv[i] = NULL; + argv[i] = oxterm ; i++; argv[i] = NULL; + argv[i] = oxtermOpt; i++; argv[i] = NULL; argv[i] = "-e"; i++; argv[i] = NULL; + if (((char *)getenv("OX_XTERM_SCROLL")) != NULL) { + argv[i] = "-sl"; i++; argv[i] = NULL; + argv[i] = (char *) getenv("OX_XTERM_SCROLL"); i++; argv[i] = NULL; + } } argv[i] = get_ox_path(); i++; argv[i] = NULL; argv[i] = "-ox"; i++; argv[i] = NULL; @@ -640,10 +648,10 @@ char **getServerEnv(char *oxServer) { }else{ if (!NoX) { if (getFileSize("/cygdrive/c/winnt/system32/cmd.exe") >= 0) { - xterm = "/cygdrive/c/winnt/system32/cmd.exe /c start /min "; + oxterm = "/cygdrive/c/winnt/system32/cmd.exe /c start /min "; argv[i] = "/cygdrive/c/winnt/system32/cmd.exe"; i++; argv[i] = NULL; }else if (getFileSize("/cygdrive/c/windows/system32/cmd.exe") >= 0) { - xterm = "/cygdrive/c/windows/system32/cmd.exe /c start /min "; + oxterm = "/cygdrive/c/windows/system32/cmd.exe /c start /min "; argv[i] = "/cygdrive/c/windows/system32/cmd.exe"; i++; argv[i] = NULL; }else{ msg_get_home(2,"cmd.exe is not found. NoX is automatically set."); @@ -1110,8 +1118,34 @@ int oxKillAll(void) { int status; for (i=0; i