From: Blaisorblade <bla...@ya...> - 2006-01-18 23:47:12
|
On Wednesday 18 January 2006 22:01, Michael Richardson wrote: > From: Michael Richardson <mc...@xe...> > the xterm that is produced for the virtual consoles should have the > --name option added. This will tell the xterm to lookup a custom resource > in the X resource database, and may permit the user to have all the > consoles associated with a given UML be the same colour. For instance, you > could put: > marajade-[~] mcr 1129 %grep east .Xresources > east*foreground: Green > east*background: Black > east*saveLines: 1000 =46rom the patch I guess that's for umid=3Deast, right? I believe to every single word of what you say, but this is black magic to= =20 me... I'm too young for this sort of things :-) > this patch added a fourth argument to the xterm definition so that the > name of the option could be changed. For gnome-terminal, perhaps > --window-with-profile will work. It looks like this option will work > without the =3D in the option, so it should work for gnome people too. If needing the =3D, they can pass it in I guess (well, we should check the= =20 option parser, guess it's happy). > static char *title_switch =3D "-T"; > +static char *name_switch =3D "-name"; =2D-name, with 2 dashes, not 1. Did you test the patch? (It seems perfectly= ok=20 for everything else). Fix this, run it and do the below proto update, and f= or=20 me it's perfectly ok to send. > static char *exec_switch =3D "-e"; > > static int __init xterm_setup(char *line, int *add) > @@ -67,6 +68,11 @@ static int __init xterm_setup(char *line > *line++ =3D '\0'; > if(*line) exec_switch =3D line; > > + line =3D strchr(line, ','); > + if(line =3D=3D NULL) return(0); > + *line++ =3D '\0'; > + if(*line) name_switch =3D line; > + > return(0); > } > > @@ -79,8 +85,8 @@ __uml_setup("xterm=3D", xterm_setup, > " respectively. The title switch must have the form '<switch> > title',\n" " not '<switch>=3Dtitle'. Similarly, the exec switch must = have > the form\n" " '<switch> command arg1 arg2 ...'.\n" > -" The default values are 'xterm=3Dxterm,-T,-e'. Values for > gnome-terminal\n" -" are 'xterm=3Dgnome-terminal,-t,-x'.\n\n" > +" The default values are 'xterm=3Dxterm,-T,-e,--name'. Values for > gnome-terminal\n" +" are > 'xterm=3Dgnome-terminal,-t,-x,--window-with-profile'.\n\n" ); > > /* XXX This badly needs some cleaning up in the error paths > @@ -93,12 +99,17 @@ int xterm_open(int input, int output, in > unsigned long stack; > int pid, fd, new, err; > char title[256], file[] =3D "/tmp/xterm-pipeXXXXXX"; > - char *argv[] =3D { terminal_emulator, title_switch, title, exec_switch, > - "/usr/lib/uml/port-helper", "-uml-socket", > + char umlname[64]; > + char *argv[] =3D { terminal_emulator, title_switch, title, > + name_switch, umlname, > + exec_switch,"/usr/lib/uml/port-helper", "-uml-socket", > file, NULL }; > > - if(os_access(argv[4], OS_ACC_X_OK) < 0) > - argv[4] =3D "port-helper"; > + /* get the UML name */ > + strcpy(umlname, get_umid(0)); The prototype just became: extern char *get_umid(void); > + if(os_access(argv[6], OS_ACC_X_OK) < 0) > + argv[6] =3D "port-helper"; > 0.99.9.GIT Update that GIT ;-) =2D-=20 Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it |