From owner-freebsd-current@FreeBSD.ORG Fri Apr 29 02:31:18 2005 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 56A1616A4CE for ; Fri, 29 Apr 2005 02:31:18 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E6F643D1D for ; Fri, 29 Apr 2005 02:31:15 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior-wifi.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.3/8.13.3) with ESMTP id j3T2ZMNd026744; Thu, 28 Apr 2005 20:35:22 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <42719BA0.5030901@samsco.org> Date: Thu, 28 Apr 2005 20:27:44 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20050218 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chuck Robey References: <427196C0.5040506@chuckr.org> In-Reply-To: <427196C0.5040506@chuckr.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org cc: current Subject: Re: tcsh 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: Fri, 29 Apr 2005 02:31:18 -0000 Chuck Robey wrote: > The first thing I do, after I've installed a new system (just before I > copy over the ssh data) is to copy my .cshrc to my home dir. What's so > important? I really like the two statements, which I show below, which > give me my prompt: > > set prompt="%m:%{^[[34m%}`id -nu`%{^[[0m%}:%~:%{^[[31m#%h^[[0m%}%#" > alias cd 'cd \!*;set prompt="%m%{^[[32m%}:`id > -nu`%{^[[0m%}:%~:%{^[[31m#%h^[[0m%}%#"' > > My mailer is adding carriage returns to the cd line, maybe even to the > prompt line, live with it. > > Any chance that something so basic as this, that improves things so > awfully much, could be added to the .tcshrc? If the idea is liked well > enough, I will edit it enough so that the special use of prompt strings > that are specific to tcsh is made conditional. Why does 'cd' have to be aliased? Doesn't 'prompt' act as a magic variable that gets re-evaluated every time it's printed? Anyways, a less colorful version that I use (can't even remember where I got it) is: set prompt = '[%B%m%b] %B%~%b%# ' Has the advantage of changing from a > to a # if you are the superuser, so it gives approximately the same info as printing the username, but in less space and without having to spawn a process every time. For extra credit, there are variations that change the xterm title bar and icon, too. Scott