From owner-freebsd-questions@FreeBSD.ORG Sun May 31 22:48:43 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBF2F106567C for ; Sun, 31 May 2009 22:48:43 +0000 (UTC) (envelope-from dickey@saltmine.radix.net) Received: from saltmine.radix.net (saltmine.radix.net [207.192.128.40]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF7F8FC15 for ; Sun, 31 May 2009 22:48:43 +0000 (UTC) (envelope-from dickey@saltmine.radix.net) Received: from saltmine.radix.net (localhost [127.0.0.1]) by saltmine.radix.net (8.12.2/8.12.2) with ESMTP id n4VMPVV4000827; Sun, 31 May 2009 18:25:31 -0400 (EDT) Received: (from dickey@localhost) by saltmine.radix.net (8.12.2/8.12.2/Submit) id n4VMPVK1000826; Sun, 31 May 2009 18:25:31 -0400 (EDT) Date: Sun, 31 May 2009 18:25:31 -0400 From: Thomas Dickey To: Robert Huff Message-ID: <20090531222531.GA21537@saltmine.radix.net> References: <18978.56856.705030.492797@jerusalem.litteratus.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fdj2RfSjLxBAspz7" Content-Disposition: inline In-Reply-To: <18978.56856.705030.492797@jerusalem.litteratus.org> User-Agent: Mutt/1.3.27i Cc: questions@freebsd.org Subject: Re: changing tab stops X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 22:48:44 -0000 --fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 31, 2009 at 03:44:24PM -0400, Robert Huff wrote: >=20 > I have a C program that writes to a terminal (currently xterm, > but could be anything). For reasons I won't go into, I would like > to read and change the terminal's tab stops ... from within the > program ... in a generic/portable way. You could make a program which does what "resize" does to find the screensize: it moves the cursor and asks where it is. (I'm not aware of an existing program which asks based on tab stops). > Is this possible? > If so, what are the keywords associated with my first clue? The control sequence that does the asking is the cursor position report (CPR). http://invisible-island.net/xterm/ctlseqs/ctlseqs.html (also vt100.net). Not all terminals implement this (for instance FreeBSD console probably does not). --=20 Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (SunOS) Comment: For info see http://www.gnupg.org iD8DBQFKIwNztIqByHxlDocRAvJzAJ0Xf7U0IRf2CW984Gvw/k1k+A0v+ACeNk1L lY/cHaiTsTJ//PpjkjCDwO0= =qbwZ -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7--