From owner-freebsd-current@FreeBSD.ORG Thu Oct 7 20:13:39 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 6664316A4CE; Thu, 7 Oct 2004 20:13:39 +0000 (GMT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2AF4343D45; Thu, 7 Oct 2004 20:13:37 +0000 (GMT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.13.1/8.13.1) with ESMTP id i97KDPoH059493; Thu, 7 Oct 2004 13:13:29 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200410072013.i97KDPoH059493@gw.catspoiler.org> Date: Thu, 7 Oct 2004 13:13:25 -0700 (PDT) From: Don Lewis To: jhb@FreeBSD.org In-Reply-To: <200410071415.45063.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii 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 20:13:39 -0000 On 7 Oct, John Baldwin wrote: > On Thursday 07 October 2004 12:44 pm, 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. > > You can use the precmd alias for that. Here's my .tcshrc.interactive file > that I use for interactive sessions: > set prompt="\n[%B%P%b] (%l) %B%n@%m%b:%.03\n%# " > if (($term =~ xterm*) || ($term == eterm)) then > alias precmd 'echo -n "]2;${USER}@${HOST}:$cwd"' > # XXX - stupid tcsh processes this for subshells! > #alias jobcmd 'echo -n "]2;${USER}@${HOST}:$cwd - \!#"' > #cwdcmd > endif I don't see any advantage to using precmd for this at least one disadvantage - with precmd, you can't use %c# to limit the length of the path printed in the title. It looks like cwdcmd would be a useful optimization if there was some way to handle exiting or suspending a remote shell session.