From owner-freebsd-questions@FreeBSD.ORG Fri Jul 23 18:24:53 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EE9B1065673 for ; Fri, 23 Jul 2010 18:24:53 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 0FD528FC23 for ; Fri, 23 Jul 2010 18:24:52 +0000 (UTC) Received: from r55.edvax.de (port-92-195-179-206.dynamic.qsc.de [92.195.179.206]) by mx02.qsc.de (Postfix) with ESMTP id 66BF31E3C9 for ; Fri, 23 Jul 2010 20:24:51 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id o6NIOorg004691 for ; Fri, 23 Jul 2010 20:24:50 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 23 Jul 2010 20:24:50 +0200 From: Polytropon To: FreeBSD Questions Message-Id: <20100723202450.ea80c86f.freebsd@edvax.de> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Text mode screen size max. compatibility X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2010 18:24:53 -0000 I'm going to write a program that will be a text mode application. In FreeBSD, the default text mode screen size is 80x25. Also, many terminal emulators for X default to that size, as well as SSH clients used in the "Windows" land. Allthough 80x25 sounds alot, it may be useful to use a bigger screen size, like on the IBM 3270 terminals that default to 132x40 (or nearly that). The modes listed in "man vidcontrol" also contain bigger sizes than 80x25: 80x30, 80x43, 80x50, 80x60, 132x25, 132x30, 132x43, 32x50, 132x60 and additionally vGA_40x25, VGA_80x25, VGA_80x30, VGA_80x50, VGA_80x60, VGA_90x25, VGA_90x30, VGA_90x43, VGA_90x50, VGA_90x60, EGA_80x25, EGA_80x43, VESA_132x25, VESA_132x43, VESA_132x50, VESA_132x60. It's also possible to use -geometry for xterm to define a similar size. Here are my questions: Is there a way to easily determine the terminal output size at program startup so the program can be preconfigured for certain screen sizes, and even refuse to run if it's less than 80x25? Can the program get any notification if the terminal output size has been changed (e. g. by changed window size), especially when running in an X terminal emulator, so it can re-arrange things? I know it takes some work (i. e. settings) to enable a bigger screen size in the default text mode, but in X, it's quite easy. If it was just that, querying $TERM and $DISPLAY would be enough to check if we're in text or in X, but how to get more information about what terminal output size is currently set in X? Oh, and the program will be written in C. Due to maximum compatibility, I want to try to keep the program in text mode (so it's easier to use it via SSH with no X server present); in any other case, I would surely default to Tcl/Tk. :-) Any suggestions or advices? -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...