UnixOperatingSystem.st
changeset 3556 03e4132de6da
parent 3555 211885c31b61
child 3558 5a6c4b491b95
--- a/UnixOperatingSystem.st	Thu Jun 11 22:36:12 1998 +0200
+++ b/UnixOperatingSystem.st	Thu Jun 11 22:48:35 1998 +0200
@@ -5913,6 +5913,26 @@
 	^ Array with:fd1 with:fd2.
     ].
     ^ nil
+!
+
+setWindowSizeOnFileDescriptor:fd width:w height:h
+    "emit a TIOCSWINSZ ioctl; (req'd for terminal emulators)"
+%{
+#ifdef TIOCSWINSZ
+    struct winsize wsize;
+
+    if (__isSmallInteger(fd)
+     && __isSmallInteger(w)
+     && __isSmallInteger(h)) {
+        wsize.ws_row = (unsigned short)__intVal(h);
+        wsize.ws_col = (unsigned short)__intVal(w);
+        if (ioctl(__intVal(fd), TIOCSWINSZ, (char *)&wsize) >= 0) {
+            RETURN (true);
+        }
+    }
+#endif
+%}.
+    ^ false
 ! !
 
 !UnixOperatingSystem class methodsFor:'misc'!
@@ -8426,6 +8446,6 @@
 !UnixOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.19 1998-06-11 20:36:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.20 1998-06-11 20:48:35 cg Exp $'
 ! !
 UnixOperatingSystem initialize!