[links-list] patch to let user override screen dimensions

Scott McDermott vaxerdec at frontiernet.net
Sat Jun 30 23:14:09 PDT 2001


My framebuffer console is very wide and certain documents are hard to
read like that.  If others feel this is useful I will try to make it
a runtime menu option that changes the values and calls the WINCH
handler.

What would be really neat is having two pages displayed side-by-side
in arbitrarily sized windows.

--- links-0.96pre6/os_dep.c     Sun Apr  8 19:10:45 2001
+++ links-0.96pre6-local/os_dep.c       Sun Jul  1 01:54:18 2001
@@ -75,10 +75,13 @@
 int get_terminal_size(int fd, int *x, int *y)
 {
        struct winsize ws;
+       int _x, _y;
        if (!x || !y) return -1;
        if (ioctl(1, TIOCGWINSZ, &ws) != -1) {
                if (!(*x = ws.ws_col) && !(*x = get_e("COLUMNS"))) *x = 80;
                if (!(*y = ws.ws_row) && !(*y = get_e("LINES"))) *y = 24;
+               if ((_x = get_e("LINKS_COLUMNS")) && _x <= *x) *x = _x;
+               if ((_y = get_e("LINKS_LINES")) && _y <= *y) *y = _y;
                return 0;
        } else {
                !(*x = get_e("COLUMNS")) && (*x = 80);

_______________________________________________
links-list mailing list
links-list at appwatch.com
http://mailman.appwatch.com/listinfo/links-list



More information about the links-list mailing list