Enhancing the user experience with tcsh
Lawrence Stewart
lstewart at freebsd.org
Fri Feb 10 01:28:46 UTC 2012
On 02/10/12 11:52, Eitan Adler wrote:
> In conf/160689 (http://www.freebsd.org/cgi/query-pr.cgi?pr=160689)
> there has been some discussion about changing the default cshrc file.
>
> I'd like to commit something like the following based on Chris's patch
> at the end of the thread. This post is an attempt to open the change
> to wider discussion.
I like the proposed changes, although I don't see why you set the prompt
twice? I've also inserted the changes I commonly run with inline below.
> commit dbe6cb730686dd53af7d06cc9b69b60e6e55549c
> diff --git a/etc/root/dot.cshrc b/etc/root/dot.cshrc
> --- a/etc/root/dot.cshrc
> +++ b/etc/root/dot.cshrc
> @@ -7,9 +7,10 @@
>
> alias h history 25
> alias j jobs -l
> -alias la ls -a
> +alias la ls -aF
> alias lf ls -FA
> -alias ll ls -lA
> +alias ll ls -lAF
> +alias ls ls -F
>
> # A righteous umask
> umask 22
> @@ -17,19 +18,24 @@ umask 22
> set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin
> /usr/local/bin $HOME/bin)
>
> setenv EDITOR vi
> -setenv PAGER more
> +setenv PAGER less
> setenv BLOCKSIZE K
# Sets SSH_AUTH_SOCK to the user's ssh-agent socket path if running
if (${?SSH_AUTH_SOCK} != "1") then
setenv SSH_AUTH_SOCK `sockstat | grep ${USER} | grep
ssh-agent | awk '{print $6}'`
endif
> if ($?prompt) then
> # An interactive shell -- set some stuff up
> set prompt = "`/bin/hostname -s`# "
# Useful for root's .cshrc, although I run with it in all my .cshrc
if (`id -g` == 0) then
set prompt="root@%m# "
endif
> set filec
> - set history = 100
> - set savehist = 100
> + set history = 10000
> + set savehist = 10000
> + set autolist
set autologout = 0
> + # Use history to aid expansion
> + set autoexpand
> set mail = (/var/mail/$USER)
> if ( $?tcsh ) then
> bindkey "^W" backward-delete-word
> bindkey -k up history-search-backward
> bindkey -k down history-search-forward
# This maps the "Delete" key to do the right thing
# Pressing CTRL-v followed by the key of interest will print the shell's
mapping for the key
bindkey "^[[3~" delete-char-or-list-or-eof
> endif
> + set prompt = "[%n@%m]%c04%# "
> + set promptchars = "%#"
> endif
>
Cheers,
Lawrence
More information about the freebsd-current
mailing list