From owner-freebsd-current@FreeBSD.ORG Thu Oct 7 18:37:16 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 D3C8D16A4D0 for ; Thu, 7 Oct 2004 18:37:16 +0000 (GMT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 485B443D2D for ; Thu, 7 Oct 2004 18:37:16 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 22841 invoked from network); 7 Oct 2004 18:37:15 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 7 Oct 2004 18:37:15 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i97Ib7ou082509; Thu, 7 Oct 2004 14:37:11 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-current@FreeBSD.org Date: Thu, 7 Oct 2004 14:15:45 -0400 User-Agent: KMail/1.6.2 References: <200410071644.i97Giq5a058914@gw.catspoiler.org> In-Reply-To: <200410071644.i97Giq5a058914@gw.catspoiler.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200410071415.45063.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: nkalev@gmail.com cc: rbgarga@gmail.com cc: Don Lewis 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:37:16 -0000 On Thursday 07 October 2004 12:44 pm, Don Lewis wrote: > On 7 Oct, Nikolay Kalev wrote: > > On Thu, 7 Oct 2004 08:25:04 -0300, Renato Botelho wrote: > >> On Thu, 7 Oct 2004 10:29:23 +0300, Nikolay Kalev wrote: > >> > Ok here is the fix. I removed F1-F6 options, will research them this > >> > weekend :-) Option CTRL+W is added, very neat thanks ! Please email me > >> > for other suggestions. > >> > >> Other thing, > >> > >> You can replace this > >> > >> if ($LOGNAME == "root") then > >> set prompt="[%B%m%b]:%S%/%s# " > >> else > >> set prompt="[%B%m%b]:%S%/%s> " > >> endif > >> > >> with > >> > >> set prompt="[%B%m%b]:%S%/%s%# " > >> > >> %# will put # to root and > to others > > > > nice thank you :-). I will release soon another fix. > > 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: # extra tcsh configuration for interactive shells setenv PAGER less setenv BLOCKSIZE K setenv EDITOR vi if ($?DISPLAY) then if ( "$DISPLAY" == ":0.0" ) then setenv EDITOR gnuclient endif endif setenv CSCOPE_EDITOR $EDITOR # An interactive shell -- set some stuff up set pushdtohome set complete=enhance set autolist=ambiguous set autoexpand set autocorrect set backslash_quote set notify set implicitcd set correct=all set rmstar set prompt="\n[%B%P%b] (%l) %B%n@%m%b:%.03\n%# " unset promptchars set ellipsis set history=200 set savehist=(200 merge) set histlit set histdup=erase set histfile=~/.history_`hostname -s` bindkey "^W" backward-delete-word bindkey -k up history-search-backward bindkey -k down history-search-forward 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 if ( -x /usr/local/bin/p4 ) then setenv P4EDITOR $EDITOR endif # set completions source ~/.completions For completions I have this: # tcsh completions # shell builtins complete limit 'c/-/(h)/' 'n/-/l/' 'p/1/l/' complete {un,}alias 'p/*/a/' complete {un,}complete 'p/*/X/' complete unset 'p/*/s/' complete unsetenv 'p/*/e/' complete which 'p/*/c/' # file operations complete {cd,rmdir,pushd} 'p/1/d/' 'p/2-/x:Only one directory allowed./' complete chgrp 'c/-/(f v h R)/' 'n/-/g/' 'p/1/g/' 'p/*/f/' complete chown 'c/-/(f v h R)/' 'c/*:/g/' 'n/-/u/' 'p/1/u/' 'p/*/f/' complete find 'n/-{,i}name/f/' 'n/-{,[acm]}newer/f/' 'n/-f/d/' \ 'n/-exec/c/' 'n/-ok/c/' 'n/-user/u/' 'n/-group/g/' \ 'n/-type/(b c d f l p s)/' \ 'c/-/(E H L P X d s x f amin anewer atime cmin cnewer ctime \ delete depth empty exec execdir flags fstype group iname inum \ ipath iregex links ls maxdepth mindepth mmin mnewer mtime name \ newer nogroup nouser ok okdir path perm print print0 prune \ regex size type user false not and or xdev)/' \ 'p/*/d/' complete ln 'c/-/(f h i n s v)/' 'p/*/f/' # other utils complete kill 'c/-/S/' 'p/*/`ps -x | grep -v PID | awk \{print\$1\}`/' complete killall 'c/-/S/' 'p/*/c/' complete umount 'c/-/(f v)/' 'C@/*@`mount -p | awk \{print\$2\}`@' 'p@*@(/)@@' complete nroff 'c/-m/(doc an)/' 'p/*/f:*.[1-9]/' # common 3rd party apps complete acroread* 'p/*/f:*.pdf/' set CVSCOMMANDS=(add admin annotate checkout commit diff edit editors export) set CVSCOMMANDS=($CVSCOMMANDS history import init log login logout pserver) set CVSCOMMANDS=($CVSCOMMANDS rannotate rdiff release remove rlog rtag server) set CVSCOMMANDS=($CVSCOMMANDS status tag unedit update version watch watchers) complete *cvs 'n/-T/d/' 'n/-e/c/' 'n/-d/d/' 'n/-H/$CVSCOMMANDS/' \ 'c/--/(help help-commands help-options help-synonyms)/' \ 'n/-r_disabled/(1.)//' 'c/-r/(1.)//' \ 'c/-/(a d e f g H l n Q q R r s T t u v w z -)/' \ 'p/1/$CVSCOMMANDS/' complete dhclient 'n/-lf/f/' 'n/-pf/f/' 'n/-cf/f/' 'n/-sf/f/' \ 'c/-/(p D d q 1 r lf pf cf sf s g n nw w)/' 'p/*/`ifconfig -l`/' complete {dvips,xdvi} 'p/*/f:*.dvi/' complete gv 'p/*/f:*.ps/' complete lynx 'p/*/f:*.htm[l]/' complete mpg123 'n/-@/f:*.m3u/' 'p/*/f:*.mp3/' if ( -x /usr/local/bin/p4 && $?P4CONFIG ) then set P4COMMANDS=`p4 help commands | grep -v Perforce | awk '{print $1}'` set P4HELPCOMMANDS=($P4COMMANDS simple commands environment \ filetypes jobview revisions usage views) complete p4 'c/-/(a c b d du f i l o s t)/' \ 'n/-b/`p4 branches | awk \{print\$2\}`/' \ 'n/-l/`p4 labels | awk \{print\$2\}`/' \ 'c/\#/(head none)/' \ 'c/@/`p4 labels | awk \{print\$2\}`/' \ 'n/branch/`p4 branches | awk \{print\$2\}`/' \ 'N/branch/`p4 branches | awk \{print\$2\}`/' \ 'n/client/`p4 clients | awk \{print\$2\}`/' \ 'N/client/`p4 clients | awk \{print\$2\}`/' \ 'n/counter/`p4 counters | awk \{print\$1\}`/' \ 'n/help/$P4HELPCOMMANDS/' \ 'n/label/`p4 labels | awk \{print\$2\}`/' \ 'n/user/`p4 users | awk \{print\$1\}`/' \ 'p/1/$P4COMMANDS/' endif complete sudo 'p/1/c/' complete xv 'p/*/f:*.{gif,jpg,jpeg,png,tiff,bmp,xpm,pnm}/' complete figlet 'n#-f#F:/usr/local/share/figlet/# #' complete cowsay 'n#-f#F:/usr/local/share/cows/# #' # FreeBSD-specific complete dd 'c/[io]f=/f/' \ 'c/conv=/(ascii block ebcdic lcase noerror notrunc osync \ sparse swab sync ucase unblock)/,' \ 'C/*/(bs cbs count files ibs if obs of seek skip conv)/=' complete burncd 'c/-/(d e f F m n p q s t v)/' 'C#/dev/#f:*cd*#' \ 'n#-f#(/dev/)##' 'n/-s/x:speed/' 'n/data/f:*.iso/' \ 'n/format/(dvd+rw)/' \ 'p/*/(msinfo blank erase format fixate raw audio data mode1 mode2 XAmode1 XAmode2 vcd dvdrw)/' complete ifconfig 'c/-/(a d u m)/' 'n/-/`ifconfig -l`/' 'p/1/`ifconfig -l`/' complete ipfw 'c/-/(a d e f q t N)/' \ 'n/add/(allow permit accept pass deny drop reject reset \ count skipto num divert port tee port)/' \ 'p/*/(flush add delete list show zero)/' complete kldunload 'c/-/(i v)/' \ 'n/-i/`kldstat | awk \{print\$1\} | egrep -v \(Id\|1\)`/' \ 'p/*/`kldstat | awk \{print\$5\} | egrep -v \(Name\|kernel\)`/' if ( `uname -r` =~ 4.* ) then complete kldload 'C#*#F:/modules/# #' else complete kldload 'p/*/f:*.ko/' endif complete pkg_{delete,info,version} 'C#*#D:/var/db/pkg/# #' complete screen 'c/-/(d list r wipe x)/' \ 'n/-d/`screen -list | grep \'^ .*Attached\' | cut -f 2`/' \ 'n/-r/`screen -list | grep \'^ .*Detached\' | cut -f 2`/' \ 'n/-wipe/`screen -list | grep \'^ .*Dead\' | cut -f 2`/' \ 'n/-x/`screen -list | egrep \'^ .*(At|De)tached\' | cut -f 2`/' complete sysctl 'p/*/`sysctl -aN`/' -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org