From owner-freebsd-current@FreeBSD.ORG Thu Oct 7 18:34:01 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49D4616A4CF; Thu, 7 Oct 2004 18:34:01 +0000 (GMT) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id AACDF43D31; Thu, 7 Oct 2004 18:33:58 +0000 (GMT) (envelope-from danfe@regency.nsu.ru) Received: from regency.nsu.ru ([193.124.210.26]) by mx.nsu.ru with esmtp (Exim 4.34) id 1CFd6b-0003xt-4E; Fri, 08 Oct 2004 01:35:09 +0700 Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.13.1/8.13.1) with ESMTP id i97HA9Tw040428; Fri, 8 Oct 2004 00:10:09 +0700 (NOVST) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.13.1/8.13.1/Submit) id i97HA9tK040407; Fri, 8 Oct 2004 00:10:09 +0700 (NOVST) (envelope-from danfe) Date: Fri, 8 Oct 2004 00:10:09 +0700 From: Alexey Dokuchaev To: Don Lewis Message-ID: <20041007171009.GA36712@regency.nsu.ru> References: <136a340a041007045538093bfd@mail.gmail.com> <200410071644.i97Giq5a058914@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410071644.i97Giq5a058914@gw.catspoiler.org> User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Fri, 08 Oct 2004 11:57:00 +0000 cc: nkalev@gmail.com cc: rbgarga@gmail.com cc: freebsd-current@freebsd.org Subject: Re: csh is root's shell? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 18:34:01 -0000 On Thu, Oct 07, 2004 at 09:44:52AM -0700, Don Lewis wrote: > This is what I use: > > set prompt = '%m:%c4 %h%#' > if ($?TERM && $TERM == xterm) then > set prompt='%{\033]0;%n@%m:%c5\007%}%m:%c %h%#' > endif > > It adds the last few components of $cwd and the history event number to > the prompt. When running in an xterm, it puts the username, hostname, > and the last part of $cwd in the xterm title. I use pretty much the same code for setting xterm's titlebar. However, there is one known problem with it: when you leave (^D) your shell, being ssh'ed to another machine, titlebar still has that remote host name. If there was a way to retrieve current title string, sigh. Unless, of course, I'm missing something here. ./danfe