diff options
author | jnweiger <jnweiger> | 2005-12-16 18:41:15 +0000 |
---|---|---|
committer | jnweiger <jnweiger> | 2005-12-16 18:41:15 +0000 |
commit | f78f9e82605ea683021b074c23524c5c4d3d7aea (patch) | |
tree | f6e071cbf6c24d668a0b5ba35f8efe7848a21076 /src/socket.c | |
parent | b3e7420c1fe103e5a3d71c3b74cf0843bee23317 (diff) | |
download | screen-f78f9e82605ea683021b074c23524c5c4d3d7aea.tar.gz |
old version screen-3.9.15 Mar 13 2003
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/src/socket.c b/src/socket.c index 57bb176..91a637e 100644 --- a/src/socket.c +++ b/src/socket.c @@ -76,6 +76,7 @@ extern char *getenv(); extern char SockPath[]; extern struct event serv_read; extern char *rc_name; +extern struct comm comms[]; #ifdef MULTIUSER # define SOCKMODE (S_IWRITE | S_IREAD | (displays ? S_IEXEC : 0) | (multi ? 1 : 0)) @@ -360,10 +361,11 @@ char *match; } if (ndead && !quietflag) { + char *m = "Remove dead screens with 'screen -wipe'."; if (wipeflag) Msg(0, "%d socket%s wiped out.", nwipe, nwipe > 1 ? "s" : ""); else - Msg(0, "Remove dead screens with 'screen -wipe'."+1-1, ndead > 1 ? "s" : "", ndead > 1 ? "" : "es"); /* other args for nethack */ + Msg(0, m, ndead > 1 ? "s" : "", ndead > 1 ? "" : "es"); /* other args for nethack */ } if (firsts != -1) { @@ -1112,6 +1114,7 @@ struct msg *m; { char *p; int pid; + int noshowwin; struct win *wi; ASSERT(display); @@ -1193,11 +1196,36 @@ struct msg *m; if (D_user->u_detachotherwin >= 0) D_other = wtab[D_user->u_detachotherwin]; - fore = FindNiceWindow(fore, *m->m.attach.preselect ? m->m.attach.preselect : 0); + noshowwin = 0; + if (*m->m.attach.preselect) + { + if (!strcmp(m->m.attach.preselect, "=")) + fore = 0; + else if (!strcmp(m->m.attach.preselect, "-")) + { + fore = 0; + noshowwin = 1; + } + else + fore = FindNiceWindow(fore, m->m.attach.preselect); + } + else + fore = FindNiceWindow(fore, 0); if (fore) SetForeWindow(fore); + else if (!noshowwin) + { +#ifdef MULTIUSER + if (!AclCheckPermCmd(D_user, ACL_EXEC, &comms[RC_WINDOWLIST])) +#endif + { + flayer = D_forecv->c_layer; + display_wlist(1); + noshowwin = 1; + } + } Activate(0); - if (!D_fore) + if (!D_fore && !noshowwin) ShowWindows(-1); if (displays->d_next == 0 && console_window) { @@ -1362,8 +1390,9 @@ struct msg *mp; display = displays; /* sigh */ if (*mp->m.command.preselect) { - int i; - i = WindowByNoN(mp->m.command.preselect); + int i = -1; + if (strcmp(mp->m.command.preselect, "-")) + i = WindowByNoN(mp->m.command.preselect); fore = i >= 0 ? wtab[i] : 0; } else if (!fore) |