- ret = ioctl(STDOUT_FILENO, TIOCSWINSZ, &w);
- printf(ESC"8");
- tcsetattr(STDOUT_FILENO, TCSANOW, &old);
+ fprintf(stderr, ESC"8");
+
+ /* BTW, other versions of resize recalculate w.ws_xpixel, ws.ws_ypixel
+ * by calculating character cell HxW from old values
+ * (gotten via TIOCGWINSZ) and recomputing *pixel values */
+ ret = ioctl(STDERR_FILENO, TIOCSWINSZ, &w);
+
+ tcsetattr(STDERR_FILENO, TCSANOW, &old);
+