From owner-freebsd-questions@FreeBSD.ORG Sun Feb 7 02:49:52 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 D174D106566B for ; Sun, 7 Feb 2010 02:49:52 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id AC42E8FC0A for ; Sun, 7 Feb 2010 02:49:52 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id o172nAL1071038 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 6 Feb 2010 18:49:13 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id o172nA7c071035; Sat, 6 Feb 2010 18:49:10 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA19485; Sat, 6 Feb 10 18:44:50 PST Date: Sat, 06 Feb 2010 18:42:13 -0800 From: perryh@pluto.rain.com To: kamikaze@bsdforen.de, m.seaman@black-earth.co.uk Message-Id: <4b6e2885.uAuY+a00oT7AqSzy%perryh@pluto.rain.com> References: <4B6D62B3.4070702@bsdforen.de> <20100206125554.GA2173@current.Sisis.de> <4B6D74EF.2090106@bsdforen.de> <4B6D80F3.7050707@black-earth.co.uk> <4B6D8377.1090005@bsdforen.de> <4B6D9B6B.40800@bsdforen.de> In-Reply-To: <4B6D9B6B.40800@bsdforen.de> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: guru@unixarea.de, freebsd-questions@freebsd.org Subject: Re: backup terminal title 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, 07 Feb 2010 02:49:52 -0000 > I wish to use the "\033]0;%s\007" sequence in a shell-script to > set the title of a terminal. But only if I am able to undo it. > > My requirement is that this must be done without using anything > outside the base system. There is an escape sequence which will cause the terminal to echo back its current title, but it's a bit tricky to use given only base-system tools because the echo ends with, IIRC, \007 rather than \n. It may be possible in some shells to temporarily set the line-end character to \007. You probably also want to (somehow) cover problematic cases like terminals that don't reply to the inquiry even though TERMCAP implies that they should.