new commands s and S. also better way to stop window output
authorEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 2 Mar 1985 09:35:01 +0000 (01:35 -0800)
committerEdward Wang <edward@ucbvax.Berkeley.EDU>
Sat, 2 Mar 1985 09:35:01 +0000 (01:35 -0800)
SCCS-vsn: usr.bin/window/cmd.c 3.31

usr/src/usr.bin/window/cmd.c

index e056418..90adf2c 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cmd.c      3.30 %G%";
+static char sccsid[] = "@(#)cmd.c      3.31 %G%";
 #endif
 
 #include "defs.h"
 #endif
 
 #include "defs.h"
@@ -72,8 +72,15 @@ docmd()
                                break;
                        case 'M':
                                if ((w = getwin()) != 0)
                                break;
                        case 'M':
                                if ((w = getwin()) != 0)
-                                       movewin(w, w->ww_altpos.r,
-                                               w->ww_altpos.c);
+                                       movewin(w, w->ww_alt.t, w->ww_alt.l);
+                               break;
+                       case 's':
+                               if ((w = getwin()) != 0)
+                                       c_size(w);
+                               break;
+                       case 'S':
+                               if ((w = getwin()) != 0)
+                                       sizewin(w, w->ww_alt.nr, w->ww_alt.nc);
                                break;
                        case ':':
                                c_colon();
                                break;
                        case ':':
                                c_colon();
@@ -109,12 +116,27 @@ docmd()
                                wwscroll(selwin, - selwin->ww_w.nr);
                                break;
                        case ctrl(s):
                                wwscroll(selwin, - selwin->ww_w.nr);
                                break;
                        case ctrl(s):
-                               (void) write(selwin->ww_pty,
-                                       &wwwintty.ww_tchars.t_stopc, 1);
+                               if (selwin->ww_pty < 0)
+                                       break;
+                               if (selwin->ww_ispty) {
+                                       (void) ioctl(selwin->ww_pty, TIOCSTOP,
+                                               (char *)0);
+                                       selwin->ww_stopped = 1;
+                               } else
+                                       (void) write(selwin->ww_pty,
+                                               &wwwintty.ww_tchars.t_stopc, 1);
                                break;
                        case ctrl(q):
                                break;
                        case ctrl(q):
-                               (void) write(selwin->ww_pty,
-                                       &wwwintty.ww_tchars.t_startc, 1);
+                               if (selwin->ww_pty < 0)
+                                       break;
+                               if (selwin->ww_ispty) {
+                                       (void) ioctl(selwin->ww_pty, TIOCSTART,
+                                               (char *)0);
+                                       selwin->ww_stopped = 0;
+                               } else
+                                       (void) write(selwin->ww_pty,
+                                               &wwwintty.ww_tchars.t_startc,
+                                               1);
                                break;
                        case ctrl(l):
                                wwredraw();
                                break;
                        case ctrl(l):
                                wwredraw();