From owner-freebsd-current@FreeBSD.ORG Fri Oct 8 19:34:42 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 E9F5B16A4CE; Fri, 8 Oct 2004 19:34:42 +0000 (GMT) Received: from mail.vicor-nb.com (bigwoop.vicor-nb.com [208.206.78.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9EFC43D1F; Fri, 8 Oct 2004 19:34:42 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (julian.vicor-nb.com [208.206.78.97]) by mail.vicor-nb.com (Postfix) with ESMTP id 9C9A07A439; Fri, 8 Oct 2004 12:34:42 -0700 (PDT) Message-ID: <4166EBD2.2010207@elischer.org> Date: Fri, 08 Oct 2004 12:34:42 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030516 X-Accept-Language: en, hu MIME-Version: 1.0 To: Alexey Dokuchaev References: <136a340a041007045538093bfd@mail.gmail.com> <200410071644.i97Giq5a058914@gw.catspoiler.org> <20041007171009.GA36712@regency.nsu.ru> In-Reply-To: <20041007171009.GA36712@regency.nsu.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: nkalev@gmail.com cc: rbgarga@gmail.com cc: Don Lewis 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: Fri, 08 Oct 2004 19:34:43 -0000 Alexey Dokuchaev wrote: >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. > alias ssh ssh_wrapper and define ssh_wrapper to be ssh $* ; settitle. (where settitle dos the above sequence for settingthe xterm title) in sh I'd use a sh function.. in csh I use: if ("$TERM" == "xterm") then alias hdr 'echo -n "^[]2;\!*^G"' alias ihdr 'echo -n "^[]1;\!*^G"' alias newhdr 'hdr "${user}@${hostname}:$cwd"' alias newihdr 'ihdr "${hostname}"' newihdr alias p 'newhdr; set prompt="${user}@${hostname}:"' else alias p 'set prompt="$USER@${hostname}:$cwd:t(\\!) " ' endif alias cd 'cd \!*; p' alias chdir 'chdir \!*; p' alias pushd 'pushd \!*; p' alias popd 'popd \!*; p' alias ssh 'ssh \!*; p' p > >./danfe >_______________________________________________ >freebsd-current@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-current >To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > >