* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)cmd.c 3.38 (Berkeley) %G%";
if ((c
= wwgetc()) < 0) {
wwputs("Command: ", cmdwin
);
while ((c
= wwgetc()) < 0);
case 'h': case 'j': case 'k': case 'l':
case '1': case '2': case '3': case '4': case '5':
case '6': case '7': case '8': case '9':
if ((w
= window
[c
- '1']) == 0) {
error("%c: No such window.", c
);
if (checkproc(selwin
) >= 0)
if (checkproc(selwin
) >= 0)
error("No previous window.");
movewin(w
, w
->ww_alt
.t
, w
->ww_alt
.l
);
sizewin(w
, w
->ww_alt
.nr
, w
->ww_alt
.nc
);
(void) wwwrite(selwin
, "\b", 1);
(void) wwwrite(selwin
, "\n", 1);
(void) wwwrite(selwin
, "\033A", 2);
(void) wwwrite(selwin
, "\033C", 2);
wwscroll(selwin
, selwin
->ww_w
.nr
/ 2);
wwscroll(selwin
, - selwin
->ww_w
.nr
/ 2);
wwscroll(selwin
, selwin
->ww_w
.nr
);
wwscroll(selwin
, - selwin
->ww_w
.nr
);
if (checkproc(selwin
) >= 0)
if (checkproc(selwin
) >= 0) {
(void) write(selwin
->ww_pty
,
error("Type ? for help.");
wwputs("Which window? ", cmdwin
);
while ((c
= wwgetc()) < 0)
else if (debug
&& c
== 'f')
else if (debug
&& c
== 'b')
else if (c
>= '1' && c
< NWINDOW
+ '1')
if (w
->ww_state
!= WWS_HASPROC
) {
error("No process in window.");
} else if (!new && incmd
) {
} else if (!new && terse
)
* Set the current window.