Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enhancing the user experience with tcsh

5 views
Skip to first unread message

Eitan Adler

unread,
Feb 9, 2012, 7:52:58 PM2/9/12
to
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.

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

if ($?prompt) then
# An interactive shell -- set some stuff up
set prompt = "`/bin/hostname -s`# "
set filec
- set history = 100
- set savehist = 100
+ set history = 10000
+ set savehist = 10000
+ set autolist
+ # 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
endif
+ set prompt = "[%n@%m]%c04%# "
+ set promptchars = "%#"
endif

--
Eitan Adler
_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"

Adrian Chadd

unread,
Feb 9, 2012, 7:59:21 PM2/9/12
to
Do the promptchars work correctly on csh as well as tcsh?


Adrian

Lawrence Stewart

unread,
Feb 9, 2012, 8:10:32 PM2/9/12
to
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

Gonzalo Nemmi

unread,
Feb 9, 2012, 10:27:46 PM2/9/12
to
On Thu, Feb 9, 2012 at 9:52 PM, Eitan Adler <li...@eitanadler.com> 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.
>
> 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
>
>  if ($?prompt) then
>        # An interactive shell -- set some stuff up
>        set prompt = "`/bin/hostname -s`# "
>        set filec
> -       set history = 100
> -       set savehist = 100
> +       set history = 10000
> +       set savehist = 10000
> +       set autolist
> +       # 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
>        endif
> +       set prompt = "[%n@%m]%c04%# "
> +       set promptchars = "%#"
>  endif
>

In the same line that Wojciech on the PR ".cshrc should be updated for
modern hardware" I always set this ones on /usr/share/skel/dot.cshrc

bindkey "\e[1~" beginning-of-line #make Home key work;
bindkey "\e[2~" overwrite-mode #make Ins key work;
bindkey "\e[3~" delete-char #make Delete key work;
bindkey "\e[4~" end-of-line #make End key work;

Besides that I add an "if [ -d $HOME/bin ]" and add it to $PATH if it
exists, but that has nothing to do with ".cshrc should be updated for
modern hardware" ... it jsut comes in really handy.

my 2 cents

Sergey V. Dyatko

unread,
Feb 10, 2012, 12:50:53 AM2/10/12
to
On Thu, 9 Feb 2012 19:52:58 -0500
what are you thinking about:
+ bindkey "^F" forward-word
+ bindkey "^B" backward-word

?

--
wbr, tiger

Warren Block

unread,
Feb 10, 2012, 1:50:06 AM2/10/12
to
On Fri, 10 Feb 2012, Gonzalo Nemmi wrote:

> On Thu, Feb 9, 2012 at 9:52 PM, Eitan Adler <li...@eitanadler.com> 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.
> In the same line that Wojciech on the PR ".cshrc should be updated for
> modern hardware" I always set this ones on /usr/share/skel/dot.cshrc
>
> bindkey "\e[1~" beginning-of-line #make Home key work;
> bindkey "\e[2~" overwrite-mode #make Ins key work;
> bindkey "\e[3~" delete-char #make Delete key work;
> bindkey "\e[4~" end-of-line #make End key work;
>
> Besides that I add an "if [ -d $HOME/bin ]" and add it to $PATH if it
> exists, but that has nothing to do with ".cshrc should be updated for
> modern hardware" ... it jsut comes in really handy.

The question becomes "how much is too much?" For example, ever since a
thread in the forums showed examples of csh/tcsh autocompletion, I've
thought the default .cshrc should be stuffed with them. Not for typing
reduction so much as self-documenting commands like

complete chown 'p/1/u/'
complete man 'C/*/c/'
complete service 'n/*/`service -l`/'

'service' autocompletes with a list of services--it helps the user by
showing valid choices. Same with 'chown', it gives a list of users.

Then there's this, which probably isn't quite right but has been useful
to me (thanks to forum members for help with it):

complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@'

That completes with all lower-case make targets for the current
directory.

Package operations are easier when the package names autocomplete:

complete pkg_delete 'c/-/(i v D n p d f G x X r)/' \
'n@*@`ls /var/db/pkg`@'
complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' \
'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@'

There's lots more that could be done. Are they appropriate for a stock
.cshrc? Maybe now is the time.

Joel Dahl

unread,
Feb 10, 2012, 3:00:58 AM2/10/12
to
On 09-02-2012 19: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.

<SNIP>

> + set autolist
> + # Use history to aid expansion
> + set autoexpand

+1 for autolist and autoexpand.

--
Joel

Adam Vande More

unread,
Feb 10, 2012, 3:08:02 AM2/10/12
to
On Thu, Feb 9, 2012 at 6:52 PM, Eitan Adler <li...@eitanadler.com> 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.
>
> 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
>
>
I don't like the change to alias ll. I use it frequently and the proposed
change makes it less readable. Otherwise, these mostly seem overdue.

--
Adam Vande More

Yamagi Burmeister

unread,
Feb 10, 2012, 4:29:05 AM2/10/12
to
On Thu, 9 Feb 2012 19:52:58 -0500
Eitan Adler <li...@eitanadler.com> 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.

If tcsh could be updated to version 6.18.00 "set autorehash" would be
really nice. With that you'll never have to type "rehash" again. :)

--
Homepage: www.yamagi.org
XMPP: yam...@yamagi.org
GnuPG/GPG: 0xEFBCCBCB

sth...@nethelp.no

unread,
Feb 10, 2012, 5:37:45 AM2/10/12
to
> If tcsh could be updated to version 6.18.00 "set autorehash" would be
> really nice. With that you'll never have to type "rehash" again. :)

Yes please!

Steinar Haug, Nethelp consulting, sth...@nethelp.no

Miroslav Lachman

unread,
Feb 10, 2012, 6:05:59 AM2/10/12
to
Warren Block wrote:
> On Fri, 10 Feb 2012, Gonzalo Nemmi wrote:
>
>> On Thu, Feb 9, 2012 at 9:52 PM, Eitan Adler <li...@eitanadler.com> 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 am +1 for better support of command autocompletion for FreeBSD
specific commands.

For example, I have this for services

complete service 'c/-/(e l r v)/' 'p/1/`service -l`/' 'n/*/(start stop
reload restart status rcvar onestart onestop)/'

Something for kernel modules

complete kldload 'n@*@`ls -1 /boot/modules/ /boot/kernel/ | awk -F/
\$NF\ \~\ \".ko\"\ \{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\}`@'

complete kldunload 'n@*@`kldstat | awk
\{sub\(\/\.ko\/,\"\",\$NF\)\;print\ \$NF\} | grep -v Name`@'

complete kill 'c/-/S/' 'c/%/j/' 'n/*/`ps -ax | awk '"'"'{print $1}'"'"'`/'
complete killall 'c/-/S/' 'c/%/j/' 'n/*/`ps -axc | awk '"'"'{print
$5}'"'"'`/'

Or for portmaster

alias _PKGS_PkGs_PoRtS_ 'awk -F\|
\{sub\(\"\/usr\/ports\/\"\,\"\"\,\$2\)\;print\ \$2\}
/usr/ports/INDEX-`uname -r | cut -d . -f 1` && pkg_info -E \*'

complete portmaster 'c/--/(always-fetch check-depends check-port-dbdir
clean-distfiles \
clean-packages delete-build-only delete-packages force-config help \
index index-first index-only list-origins local-packagedir
no-confirm \
no-index-fetch no-term-title packages packages-build
packages-if-newer \
packages-local packages-only show-work update-if-newer version)/' \
'c/-/(a b B C d D e f F g G h H i l L m n o p r R s t u v w x)/' \
'n@*@`_PKGS_PkGs_PoRtS_`@'

The alias is there because same list of ports and packages are used for
other pkg / ports commands (portupgrade, pkg_info, pkg_delete, pkg_tree,
portell etc...)

I have collected completion for about 50 commands like: vim, where,
which, dd, find, man, limit, kill, bzip2, camcontrol, ifconfig, postfix,
postmap, mount, su, sed, sysctl, make etc..
Come of them are rough and need some tweaks.

I would like to share them with others, if there are interrest to
include it in stock FreeBSD base.


And if we are talking about better completion and history support, what
about following?

set history=10000
set histdup=prev
set savehist=(10000 merge)
set autolist=ambiguous
set autocorrect
set autoexpand
set complete
set correct=cmd
set color
set colorcat
set filec

At last - if you are using screen or tmux and what properly saved and
merged history from all screens after logout, you need to add
history -S
to the ~.logout file. Otherwise I have saved history only from last
screen window.

Miroslav Lachman

Erich Dollansky

unread,
Feb 10, 2012, 3:22:46 AM2/10/12
to
Hi,

On Friday 10 February 2012 13:50:06 Warren Block wrote:
> On Fri, 10 Feb 2012, Gonzalo Nemmi wrote:
>
> > On Thu, Feb 9, 2012 at 9:52 PM, Eitan Adler <li...@eitanadler.com> wrote:
> >> In conf/160689 (http://www.freebsd.org/cgi/query-pr.cgi?pr=160689)
>
> The question becomes "how much is too much?" For example, ever since a

why not make an example rc file and let the users chose from?

> complete chown 'p/1/u/'
> complete man 'C/*/c/'
> complete service 'n/*/`service -l`/'

I have the habit to collect things like this and add it to my installations from time to time. I watch then how it develops. Some have disturbing side effects to a person's working style. These will be removed later. Others stay then.

Erich

Erich Dollansky

unread,
Feb 10, 2012, 7:02:09 AM2/10/12
to
Hi,

On Friday 10 February 2012 18:05:59 Miroslav Lachman wrote:
> Warren Block wrote:
> > On Fri, 10 Feb 2012, Gonzalo Nemmi wrote:
> >
>
> I would like to share them with others, if there are interrest to
> include it in stock FreeBSD base.
>
just publish them at least here. It will always be helpful for beginners and also for people like me who use BSD since years but did not see certain options tcsh has.

Miroslav Lachman

unread,
Feb 10, 2012, 7:39:48 AM2/10/12
to
Erich Dollansky wrote:
> Hi,
>
> On Friday 10 February 2012 18:05:59 Miroslav Lachman wrote:
>> Warren Block wrote:
>>> On Fri, 10 Feb 2012, Gonzalo Nemmi wrote:
>>>
>>
>> I would like to share them with others, if there are interrest to
>> include it in stock FreeBSD base.
>>
> just publish them at least here. It will always be helpful for beginners and also for people like me who use BSD since years but did not see certain options tcsh has.

OK, here it is http://freebsd.quip.cz/ext/2012/2012-02-10-tcshrc/

It is based on tcshrc files found on the net, so it is not all my work.
The files include many commented out lines as I change them over time.
You can use it as inspiration for your own set of useful cahnges in you
tcshrc files.

Miroslav Lachman

Joel Dahl

unread,
Feb 10, 2012, 7:49:48 AM2/10/12
to
On 09-02-2012 23:50, Warren Block wrote:
> On Fri, 10 Feb 2012, Gonzalo Nemmi wrote:
>
> > On Thu, Feb 9, 2012 at 9:52 PM, Eitan Adler <li...@eitanadler.com> 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.
> > In the same line that Wojciech on the PR ".cshrc should be updated for
> > modern hardware" I always set this ones on /usr/share/skel/dot.cshrc
> >
> > bindkey "\e[1~" beginning-of-line #make Home key work;
> > bindkey "\e[2~" overwrite-mode #make Ins key work;
> > bindkey "\e[3~" delete-char #make Delete key work;
> > bindkey "\e[4~" end-of-line #make End key work;
> >
> > Besides that I add an "if [ -d $HOME/bin ]" and add it to $PATH if it
> > exists, but that has nothing to do with ".cshrc should be updated for
> > modern hardware" ... it jsut comes in really handy.
>
> The question becomes "how much is too much?" For example, ever since a
> thread in the forums showed examples of csh/tcsh autocompletion, I've
> thought the default .cshrc should be stuffed with them. Not for typing
> reduction so much as self-documenting commands like
>
> complete chown 'p/1/u/'
> complete man 'C/*/c/'
> complete service 'n/*/`service -l`/'
>
> 'service' autocompletes with a list of services--it helps the user by
> showing valid choices. Same with 'chown', it gives a list of users.
>
> Then there's this, which probably isn't quite right but has been useful
> to me (thanks to forum members for help with it):
>
> complete make 'n@*@`make -pn | sed -n -E "/^[#_.\/[:blank:]]+/d; /=/d; s/[[:blank:]]*:.*//gp;"`@'
>
> That completes with all lower-case make targets for the current
> directory.
>
> Package operations are easier when the package names autocomplete:
>
> complete pkg_delete 'c/-/(i v D n p d f G x X r)/' \
> 'n@*@`ls /var/db/pkg`@'
> complete pkg_info 'c/-/(a b v p q Q c d D f g i I j k K r R m L s o G O x X e E l t V P)/' \
> 'n@*@`\ls -1 /var/db/pkg | sed s%/var/db/pkg/%%`@'

How about adding stuff like this to /usr/share/examples/tcsh/complete.tcsh ?

--
Joel

Alexander Leidinger

unread,
Feb 10, 2012, 7:36:29 AM2/10/12
to
Quoting Miroslav Lachman <000....@quip.cz> (from Fri, 10 Feb 2012
12:05:59 +0100):

> I would like to share them with others, if there are interrest to
> include it in stock FreeBSD base.

If there's no interest, or no consent to add a specific one, why not
collect them in a wiki-page?

Bye,
Alexander.

--
BOFH excuse #306:

CPU-angle has to be adjusted because of vibrations coming from the nearby road

http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137

Erich Dollansky

unread,
Feb 10, 2012, 8:37:30 AM2/10/12
to
Hi,

On Friday 10 February 2012 19:36:29 Alexander Leidinger wrote:
> Quoting Miroslav Lachman <000....@quip.cz> (from Fri, 10 Feb 2012
> 12:05:59 +0100):
>
> > I would like to share them with others, if there are interrest to
> > include it in stock FreeBSD base.
>
> If there's no interest, or no consent to add a specific one, why not
> collect them in a wiki-page?

this is a good idea as this can be easily updated by everybody and does not put any load onto the project itself. One note in the make file would do.

Erich

Eitan Adler

unread,
Feb 10, 2012, 9:03:52 AM2/10/12
to
Picking a random person to reply to.

There are a lot of good suggestions in this thread, but can we please
remember a few things:

- Users can always add their own ~/.cshrc
- Many users will get annoyed by what is someone else's amazing setup

The changes I proposed were designed to add value while continuing to
be non-annoying to the vast majority of users. I'd like feedback about
the specific patch I proposed. We can also create a wiki page for
more awesome tcsh examples.

For the record this is the current version of the patch I'd like to
commit: Note that it slightly changed from the original (I removed the
duplicate prompt setup and reorganized where the edits are made to
make the diff look nicer).

commit 3ea4ea3a59d14cb060244618dd89d7dd0170bee1
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,15 +18,19 @@ 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

if ($?prompt) then
# An interactive shell -- set some stuff up
- set prompt = "`/bin/hostname -s`# "
+ set prompt = "[%n@%m]%c04%# "
+ set promptchars = "%#"
set filec
- set history = 100
- set savehist = 100
+ set history = 10000
+ set savehist = 10000
+ set autolist
+ # Use history to aid expansion
+ set autoexpand
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word




--
Eitan Adler

Miroslav Lachman

unread,
Feb 10, 2012, 9:29:33 AM2/10/12
to
Eitan Adler wrote:
> Picking a random person to reply to.
>
> There are a lot of good suggestions in this thread, but can we please
> remember a few things:
>
> - Users can always add their own ~/.cshrc
> - Many users will get annoyed by what is someone else's amazing setup

The main problem of this is: novice user don't know how to enable some
"advanced" settings for default FreeBSD shell (csh / tcsh) or even don't
know they exist. But all skilled persons are able to disable "annoing"
new settings in few seconds.

I think that default FreeBSD install should be more friendly to new
users. That's why I am propossing better support of command completion
"out of the box".
(I will still use my own set of changes in rc files which I am deploying
in a first step on all our machines)

[...]
I am fine with this change. It is better than nothing. :)

Miroslav Lachman

Anton Shterenlikht

unread,
Feb 10, 2012, 9:43:45 AM2/10/12
to
On Fri, Feb 10, 2012 at 09:03:52AM -0500, Eitan Adler wrote:
> Picking a random person to reply to.
>
> There are a lot of good suggestions in this thread, but can we please
> remember a few things:
>
> - Users can always add their own ~/.cshrc
> - Many users will get annoyed by what is someone else's amazing setup
>
> The changes I proposed were designed to add value while continuing to
> be non-annoying to the vast majority of users. I'd like feedback about
> the specific patch I proposed. We can also create a wiki page for
> more awesome tcsh examples.
>
yes to the history improvements
no to the prompt changes
don't care for aliases - I never use these particular ones.

--
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423

Erich Dollansky

unread,
Feb 10, 2012, 9:57:58 AM2/10/12
to
Hi Eitan,

On Friday 10 February 2012 21:03:52 Eitan Adler wrote:
> Picking a random person to reply to.
>
> There are a lot of good suggestions in this thread, but can we please
> remember a few things:
>
> - Users can always add their own ~/.cshrc
> - Many users will get annoyed by what is someone else's amazing setup

sorry for going a bit far off your route.
>
> The changes I proposed were designed to add value while continuing to
> be non-annoying to the vast majority of users. I'd like feedback about
> the specific patch I proposed. We can also create a wiki page for
> more awesome tcsh examples.
>
> For the record this is the current version of the patch I'd like to
> commit: Note that it slightly changed from the original (I removed the
> duplicate prompt setup and reorganized where the edits are made to
> make the diff look nicer).
>
> commit 3ea4ea3a59d14cb060244618dd89d7dd0170bee1
> 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

ok, makes sense.

> alias lf ls -FA
> -alias ll ls -lA
> +alias ll ls -lAF
> +alias ls ls -F
>
ok, makes sense.

> # A righteous umask
> umask 22
> @@ -17,15 +18,19 @@ umask 22
> set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin
> /usr/local/bin $HOME/bin)

I use the $HOME/bin on my machines but I am not so sure to make this a general thing.

>
> setenv EDITOR vi
> -setenv PAGER more
> +setenv PAGER less
> setenv BLOCKSIZE K

ok, makes sense.

>
> if ($?prompt) then
> # An interactive shell -- set some stuff up
> - set prompt = "`/bin/hostname -s`# "
> + set prompt = "[%n@%m]%c04%# "
> + set promptchars = "%#"

I would add a

set ellipsis

here. It makes the prompt shorter when needed.

> set filec
> - set history = 100
> - set savehist = 100
> + set history = 10000
> + set savehist = 10000
> + set autolist
> + # Use history to aid expansion
> + set autoexpand
> set mail = (/var/mail/$USER)
> if ( $?tcsh ) then
> bindkey "^W" backward-delete-word
>
Ok again.

Erich
>
>
>
> --
> Eitan Adler

Warren Block

unread,
Feb 10, 2012, 10:31:24 AM2/10/12
to
On Fri, 10 Feb 2012, Joel Dahl wrote:

[completion examples]

> How about adding stuff like this to /usr/share/examples/tcsh/complete.tcsh ?

Along with a comment in .cshrc pointing to that file (or even a
commented line to source it), it would be an improvement. People who
can benefit the most from the self-documenting aspect of command
completion are the same ones that don't know how much it can help.

Gavin Atkinson

unread,
Feb 10, 2012, 10:27:07 AM2/10/12
to
On Thu, 2012-02-09 at 19:52 -0500, 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.
>
> 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

Please, no.

> # 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

Probably sensible.

> if ($?prompt) then
> # An interactive shell -- set some stuff up
> set prompt = "`/bin/hostname -s`# "
> set filec
> - set history = 100
> - set savehist = 100
> + set history = 10000
> + set savehist = 10000
> + set autolist

I think it'd be better for this to be "set autolist=ambiguous" - it
changes an accidental keypress into a deliberate choice, and matches
Linux a bit better.

> + # 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
> endif
> + set prompt = "[%n@%m]%c04%# "
> + set promptchars = "%#"
> endif

I always override the prompt anyway. My personal favourite is
set prompt="%B%n@`hostname -s`%b:%/ %h% "
but I see no real problem with the suggested prompt (although
set prompt = "%n@%m:%c04%# "
would at least save one character.

Gavin

Chris Rees

unread,
Feb 10, 2012, 10:45:53 AM2/10/12
to
On 10 Feb 2012 14:58, "Erich Dollansky" <erichfre...@ovitrap.com>
wrote:
>
> Hi Eitan,
>
> On Friday 10 February 2012 21:03:52 Eitan Adler wrote:
> > Picking a random person to reply to.
> >
> > There are a lot of good suggestions in this thread, but can we please
> > remember a few things:
> >
> > - Users can always add their own ~/.cshrc
> > - Many users will get annoyed by what is someone else's amazing setup
>
> sorry for going a bit far off your route.
> >
> > The changes I proposed were designed to add value while continuing to
> > be non-annoying to the vast majority of users. I'd like feedback about
> > the specific patch I proposed. We can also create a wiki page for
> > more awesome tcsh examples.
> >
> > For the record this is the current version of the patch I'd like to
> > commit: Note that it slightly changed from the original (I removed the
> > duplicate prompt setup and reorganized where the edits are made to
> > make the diff look nicer).
> >
> > commit 3ea4ea3a59d14cb060244618dd89d7dd0170bee1
> > 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
>
> ok, makes sense.
>
> > alias lf ls -FA
> > -alias ll ls -lA
> > +alias ll ls -lAF
> > +alias ls ls -F
> >
> ok, makes sense.
>
> > # A righteous umask
> > umask 22
> > @@ -17,15 +18,19 @@ umask 22
> > set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin
> > /usr/local/bin $HOME/bin)
>
> I use the $HOME/bin on my machines but I am not so sure to make this a
general thing.
>
> >
> > setenv EDITOR vi
> > -setenv PAGER more
> > +setenv PAGER less
> > setenv BLOCKSIZE K
>
> ok, makes sense.
>
> >
> > if ($?prompt) then
> > # An interactive shell -- set some stuff up
> > - set prompt = "`/bin/hostname -s`# "
> > + set prompt = "[%n@%m]%c04%# "
> > + set promptchars = "%#"
>
> I would add a
>
> set ellipsis
>
> here. It makes the prompt shorter when needed.
>

Hence the %c04 modification to the path :)

Chris

Volodymyr Kostyrko

unread,
Feb 10, 2012, 10:53:09 AM2/10/12
to
Eitan Adler wrote:
> set filec
> - set history = 100
> - set savehist = 100
> + set history = 10000
> + set savehist = 10000

Just why not (10000 merge)?

> + set autolist
> + # 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
> endif
> + set prompt = "[%n@%m]%c04%# "
> + set promptchars = "%#"
> endif
>

I'm fully against changing promptchars, that's pointless. Including more
useful data in prompt is good anyway, but why any [] around? I think
everything should be just a little more descriptive, like:

set prompt = "%n@%m %c04%m%# "

--
Sphinx of black quartz judge my vow.

Eitan Adler

unread,
Feb 10, 2012, 11:25:08 AM2/10/12
to
Picking a random email to reply to.

My goal with this email is to reduce the amount of "controversial" changes.

commit 3ea4ea3a59d14cb060244618dd89d7dd0170bee1
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

Two people didn't like these changes but didn't explain why. This is
incredibly helpful, especially for a new user. If you dislike the
alias change please explain what bothers you about it?

# A righteous umask
umask 22
@@ -17,15 +18,19 @@ 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

No one complained about this - it is almost certainly going to stay it
the final version.


if ($?prompt) then
# An interactive shell -- set some stuff up
- set prompt = "`/bin/hostname -s`# "
+ set prompt = "[%n@%m]%c04%# "
+ set promptchars = "%#"

Many people had alternative suggestions for the prompt. Can you please
clarify why you believe your prompt should be the _default_ one?
While many admins are able to deal with short non-descriptive prompts
it helps new users to have more detail on the prompt line. I'd like to
commit some change to the default: currently it is very undescriptive.
I am leaving open which prompt I am going with at the end though.

set filec
- set history = 100
- set savehist = 100
+ set history = 10000
+ set savehist = 10000

No one complained about this one - it is almost certainly going to
stay it the final version.

+ set autolist

set autolist=ambiguous makes sense here - I will likely go with that.

+ # Use history to aid expansion
+ set autoexpand

No one complained about this - it is almost certainly going to stay
it the final version.

Now to address some comments made in the thread. I'm sorry for not
preserving attribution here.

> How about adding stuff like this to /usr/share/examples/tcsh/complete.tcsh ?
> Along with a comment in .cshrc pointing to that file (or even a commented line to source it), it would be an improvement.

+1 I'll add a comment addressing this file.

> I use the $HOME/bin on my machines but I am not so sure to make this a general thing.

Many people expect it, and given that it is the last item in the path
it won't affect all that much.

> The main problem of this is: novice user don't know how to enable some "advanced" settings for default FreeBSD shell (csh / tcsh) or even don't know they exist.

This is why I want to make the defaults a little bit nicer.

> I think that default FreeBSD install should be more friendly to new users.
+10000

> That's why I am propossing better support of command completion "out of the box".
> ... I am fine with this change. It is better than nothing. :)

Good. Lets start with incremental positive steps :)

>If tcsh could be updated to version 6.18.00 "set autorehash" would be
>really nice. With that you'll never have to type "rehash" again. :)

This would solve one of the most frequently asked questions on the
mailing list and IRC channel. Is there any objection to setting this
once tcsh is updated?

> The question becomes "how much is too much?"

This is why I want to keep my patch minimal. It is better at this
moment to miss a few good changes to the default tcsh than make a
large number of bad ones. We could always edit the file again if we
find a better set of defaults.


--
Eitan Adler

Gavin Atkinson

unread,
Feb 10, 2012, 11:41:41 AM2/10/12
to
On Fri, 2012-02-10 at 11:25 -0500, Eitan Adler wrote:
> Picking a random email to reply to.
>
> My goal with this email is to reduce the amount of "controversial" changes.

I applaud this. I've often considered doing the same but avoided it
because it was easier than fighting the bikeshed :)

> commit 3ea4ea3a59d14cb060244618dd89d7dd0170bee1
> 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
>
> Two people didn't like these changes but didn't explain why. This is
> incredibly helpful, especially for a new user. If you dislike the
> alias change please explain what bothers you about it?

I don't use the first two aliases, so I don't care about them at all. I
do however disagree strongly with changing the default options on such a
widely used command.

This change is disruptive, and it can affect use of ls(1) in scripts.
For example, it even sticks the extra characters in the output of
"ls -1" (the number 1), which is specifically designed to be used when
piping the output elsewhere. Please do not break this. It is also
distracting - If I want to see what type of file a particular entry is,
why not just run "ls -l"?

It's like the tendency some Linux distributions have of
"alias mv mv -i", although that can at least be overridden on the
command line with "-f". The "ls -F" change cannot be overridden without
unaliasing.

> if ($?prompt) then
> # An interactive shell -- set some stuff up
> - set prompt = "`/bin/hostname -s`# "
> + set prompt = "[%n@%m]%c04%# "
> + set promptchars = "%#"
>
> Many people had alternative suggestions for the prompt. Can you please
> clarify why you believe your prompt should be the _default_ one?

I can't comment as I didn't say my suggestion should be default - but
for me the above isn't a bad choice. I would however prefer:
set prompt = "%n@%m:%c04 %# "
and not
set prompt = "[%n@%m]%c04%# "

as that then gives you user@host:path in exactly the same format as you
need to use with scp, etc.


> > I use the $HOME/bin on my machines but I am not so sure to make this a general thing.
>
> Many people expect it, and given that it is the last item in the path
> it won't affect all that much.

It's been in there forever. I think this should stay, it would just be
too disruptive otherwise.

Gavin

Chuck Burns

unread,
Feb 10, 2012, 12:07:29 PM2/10/12
to
My $0.02

Instead of using -F to denote filetypes, why not use colors? -G -- it
shouldnt affect scripts at all, yet still provide the same sort of
feedback. (Tho, I personally use csh's built-in "ls-F" instead of "ls",
and actually tend to alias it to ls as well.)

Just a thought.

I do, however, like most of the other changes. Here's my stamp.
"Approved" :)

--
Chuck Burns
The Southern Libertarian (owner/editor)
http://www.thesouthernlibertarian.com/

Kevin Oberman

unread,
Feb 10, 2012, 12:21:33 PM2/10/12
to
I want mine green with yellow trim.

That said, if you really want to look at massive .tcshrc setup, look
at shells/tcshrc. It's woefully out of date and the latest version
upstream has a lot more cool stuff, but it takes a lot of hacking
since it's written for Linux. (I still need to fix auto-complete for
route(8).) It's really got all of the bells and whistles , but I don't
think it's for everyone and I certainly tend to heavily modify my own.
--
R. Kevin Oberman, Network Engineer
E-mail: kob...@gmail.com

Edho Arief

unread,
Feb 10, 2012, 11:58:13 AM2/10/12
to
On Fri, Feb 10, 2012 at 11:41 PM, Gavin Atkinson
<gavin.a...@ury.york.ac.uk> wrote:
> This change is disruptive, and it can affect use of ls(1) in scripts.

Scripts never use alias and...

> For example, it even sticks the extra characters in the output of
> "ls -1" (the number 1), which is specifically designed to be used when
> piping the output elsewhere.  Please do not break this.  It is also

...actually, don't ever parse ls output.

http://mywiki.wooledge.org/ParsingLs

> command line with "-f".  The "ls -F" change cannot be overridden without
> unaliasing.
>

Try prepending the command with backslash to run unaliased command.

\ls


--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Wojciech A. Koszek

unread,
Feb 10, 2012, 12:25:03 PM2/10/12
to
On czw, lut 09, 2012 at 11:50:06 -0700, Warren Block wrote:
> On Fri, 10 Feb 2012, Gonzalo Nemmi wrote:
> `
> > On Thu, Feb 9, 2012 at 9:52 PM, Eitan Adler <li...@eitanadler.com> 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.
> There's lots more that could be done. Are they appropriate for a stock
> .cshrc? Maybe now is the time.

One of the solutions for this problem would be to have:

"source /usr/share/..../csh/autocomplete.csh"

in .cshrc. I don't know what the shell speed impact might be, however.

--
Wojciech A. Koszek
wko...@FreeBSD.czest.pl
http://FreeBSD.czest.pl/~wkoszek/

Wojciech A. Koszek

unread,
Feb 10, 2012, 12:29:36 PM2/10/12
to
On Fri, Feb 10, 2012 at 05:53:09PM +0200, Volodymyr Kostyrko wrote:
> Eitan Adler wrote:
> > set filec
> > - set history = 100
> > - set savehist = 100
> > + set history = 10000
> > + set savehist = 10000
>
> Just why not (10000 merge)?
>
> > + set autolist
> > + # 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
> > endif
> > + set prompt = "[%n@%m]%c04%# "
> > + set promptchars = "%#"
> > endif
> >
>
> I'm fully against changing promptchars, that's pointless. Including more
> useful data in prompt is good anyway, but why any [] around? I think
> everything should be just a little more descriptive, like:
>
> set prompt = "%n@%m %c04%m%# "

Agreed. Try to make it as short as possible, but not shorter. Remember to
check whatever you've done on 80x25 screen. Eatting 25% of the width for the
prompt isn't practical.

Stefan Esser

unread,
Feb 10, 2012, 12:40:18 PM2/10/12
to
Those aliases are only meant for interactive use and should be hidden in
batch shells, IMO.

> This change is disruptive, and it can affect use of ls(1) in scripts.
> For example, it even sticks the extra characters in the output of
> "ls -1" (the number 1), which is specifically designed to be used when
> piping the output elsewhere. Please do not break this. It is also
> distracting - If I want to see what type of file a particular entry is,
> why not just run "ls -l"?

Yes, having -F modify the output of "ls -1" is bad ...
But "ls -l" is no replacement for "ls -F", in general.

> It's like the tendency some Linux distributions have of
> "alias mv mv -i", although that can at least be overridden on the
> command line with "-f". The "ls -F" change cannot be overridden without
> unaliasing.

Well, it can ... There is no need to unalias a command:

> alias ls ls -F
> ls -d /etc
/etc/
> \ls -d /etc
/etc

Just put a back-slash before the command to use the "pure" version ...

Regards, STefan

Alex Keda

unread,
Feb 10, 2012, 2:22:44 PM2/10/12
to
On 10.02.2012 21:07, Chuck Burns wrote:
> set prompt = "[%n@%m]%c04%# "
it's not needed

need some as
alias ll ls -lAhG
alias ls ls -G
set autolist = TAB
bindkey "\e[3~" delete-char
........
and other _really_ necessary settings

> complete chown 'p/1/u/'
> complete man 'C/*/c/'
> complete service 'n/*/`service -l`/'
need as example. may be in include file, may be in .cshrc

Chris Rees

unread,
Feb 10, 2012, 4:32:18 PM2/10/12
to
On 10 Feb 2012 19:41, "Alex Keda" <ad...@lissyara.su> wrote:
>
> On 10.02.2012 21:07, Chuck Burns wrote:
>>
>> set prompt = "[%n@%m]%c04%# "
>
> it's not needed
>
> need some as
> alias ll ls -lAhG
> alias ls ls -G

Lscolors are an abomination. -F or nothing at all is better; remember some
people will use white xterms etc.

Chris

Andriy Gapon

unread,
Feb 10, 2012, 5:12:49 PM2/10/12
to

[cc list trimmed]

on 10/02/2012 18:25 Eitan Adler said the following:
[snip]
> 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
> No one complained about this - it is almost certainly going to stay it
> the final version.


Not so fast there, partner :-) Give folks more time to react.

I really hate the default behavior of less where you can't quit via ^C or via
paging through the end of file.

BTW, this is what I have here:
setenv PAGER more
setenv MORE '-e -R -Pm?f%f:stdin .?lbLine %lb:?pb%pb\%:?bbByte %bb:-... ?eEND'

> set filec
> - set history = 100
> - set savehist = 100
> + set history = 10000
> + set savehist = 10000
>
> No one complained about this one - it is almost certainly going to
> stay it the final version.

10000 looks a bit too much. I recall using systems where setting this to 10000
caused exiting from a shell to be a very long process.
Maybe try 1000 first, before trying more.

Also, I second a suggestion to add merge directive to savehist.

--
Andriy Gapon

Chuck Swiger

unread,
Feb 10, 2012, 5:29:06 PM2/10/12
to
On Feb 10, 2012, at 2:12 PM, Andriy Gapon wrote:
> I really hate the default behavior of less where you can't quit via ^C or via
> paging through the end of file.

It's readily tunable, by setenv'ing LESS variable to contain some of:

-e or --quit-at-eof
Causes less to automatically exit the second time it reaches end-of-file. By default,
the only way to exit less is via the "q" command.

-E or --QUIT-AT-EOF
Causes less to automatically exit the first time it reaches end-of-file.

-K or --quit-on-intr
Causes less to exit immediately when an interrupt character (usually ^C) is typed.
Normally, an interrupt character causes less to stop whatever it is doing and return to
its command prompt. Note that use of this option makes it impossible to return to the
command prompt from the "F" command.

While we return folks to the regularly scheduled debate on fancier .cshrc setup, I think I'd be happier with some of these changes showing up as examples, and having people try them out and look for any unexpected side effects before adopting them wholesale into the default system-wide dot.cshrc template...

Regards,
--
-Chuck

Oliver Pinter

unread,
Feb 10, 2012, 6:13:20 PM2/10/12
to
On 2/10/12, Eitan Adler <li...@eitanadler.com> 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.
>
> 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
>
> if ($?prompt) then
> # An interactive shell -- set some stuff up
> set prompt = "`/bin/hostname -s`# "
> set filec
> - set history = 100
> - set savehist = 100
> + set history = 10000
> + set savehist = 10000
> + set autolist
> + # 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
> endif
> + set prompt = "[%n@%m]%c04%# "
> + set promptchars = "%#"
> endif
>
> --
> Eitan Adler
> _______________________________________________
> freebsd...@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-curre...@freebsd.org"
>

this is what I use, this based on somewhat, that I found before ~3
years in Internet + mostly rewrited and extended:

http://oliverp.teteny.bme.hu/git/?p=base/tcshrc.git;a=tree

Andriy Gapon

unread,
Feb 10, 2012, 6:45:56 PM2/10/12
to
on 11/02/2012 00:29 Chuck Swiger said the following:
> On Feb 10, 2012, at 2:12 PM, Andriy Gapon wrote:
>> I really hate the default behavior of less where you can't quit via ^C or via
>> paging through the end of file.
>
> It's readily tunable, by setenv'ing LESS variable to contain some of:
>
> -e or --quit-at-eof
> Causes less to automatically exit the second time it reaches end-of-file. By default,
> the only way to exit less is via the "q" command.
>
> -E or --QUIT-AT-EOF
> Causes less to automatically exit the first time it reaches end-of-file.
>
> -K or --quit-on-intr
> Causes less to exit immediately when an interrupt character (usually ^C) is typed.
> Normally, an interrupt character causes less to stop whatever it is doing and return to
> its command prompt. Note that use of this option makes it impossible to return to the
> command prompt from the "F" command.

Exactly. So my larger point is that less and more are actually the same binary
and whatever behavior a user prefers can be achieved via MORE or LESS. Neither
of the default behaviors was satisfactory enough personally for me.

--
Andriy Gapon

Stephen McKay

unread,
Feb 10, 2012, 9:41:30 PM2/10/12
to
On Friday, 10th February 2012, Eitan Adler wrote:

>-alias la ls -a
>+alias la ls -aF
> alias lf ls -FA
>-alias ll ls -lA
>+alias ll ls -lAF
>+alias ls ls -F
>
>Two people didn't like these changes but didn't explain why. This is
>incredibly helpful, especially for a new user. If you dislike the
>alias change please explain what bothers you about it?

You should never, ever alias over a standard command in a default profile.
It will only train new users incorrectly. Having to use \ls to get the
real ls is not an answer. If you think -F should be the default behaviour
of ls, commit it directly to the ls source. Then run away fast! :-)

As for the other ls aliases, I don't see the point given "lf" already
exists. My only advice for your overall .cshrc changes is to be minimal
and aim low. You may have a chance at consensus then. Good luck!

By the way, one of the nice things about FreeBSD vs Linux is that less
shell configuration is set up by default, so less work is needed to
undo it all before you can get your own settings done. Every "helpful"
thing that is set in /.cshrc or any other global config file is something
someone somewhere will have to discover and turn off. Try not to make
it too hard for them.

Stephen.

Joel Dahl

unread,
Feb 11, 2012, 3:07:31 AM2/11/12
to
On 10-02-2012 9:03, Eitan Adler wrote:
> Picking a random person to reply to.
>
> There are a lot of good suggestions in this thread, but can we please
> remember a few things:
>
> - Users can always add their own ~/.cshrc
> - Many users will get annoyed by what is someone else's amazing setup

With the above in mind, I suggest we change as little as possible from what
we have today (for now) and that we do improvements in small steps.

I believe 99.99% of all users would find the change below to be a definite
improvement over the current default values in .cshrc:

Index: dot.cshrc
===================================================================
--- dot.cshrc (revision 231507)
+++ dot.cshrc (working copy)
@@ -24,8 +24,10 @@
# An interactive shell -- set some stuff up
set prompt = "`/bin/hostname -s`# "
set filec
- set history = 100
- set savehist = 100
+ set history = 1000
+ set savehist = (1000 merge)
+ set autolist
+ set autoexpand
set mail = (/var/mail/$USER)
if ( $?tcsh ) then
bindkey "^W" backward-delete-word

Also, a comment pointing to /usr/share/examples/tcsh/complete.tcsh would
be a nice addition to the default .cshrc.

--
Joel

Matt Thyer

unread,
Feb 12, 2012, 8:44:39 AM2/12/12
to
> How about adding stuff like this to
/usr/share/examples/tcsh/complete.tcsh ?
>
> --
> Joel

Yes to that.

This is exactly where these suggestions should go.

Feel free to create multiple examples files there but be very carefully
with changes to system wide defaults.

Volodymyr Kostyrko

unread,
Feb 13, 2012, 8:23:36 AM2/13/12
to
Alex Keda wrote:
> On 10.02.2012 21:07, Chuck Burns wrote:
>> set prompt = "[%n@%m]%c04%# "
> it's not needed
>
> need some as
> alias ll ls -lAhG
> alias ls ls -G
> set autolist = TAB
> bindkey "\e[3~" delete-char
> .........
> and other _really_ necessary settings

This can be as simple as defining CLICOLOR. However colors of ls -G
wouldn't match with default color set in LSCOLORS so correct LS_COLORS
string would be needed too.

--
Sphinx of black quartz judge my vow.

timp

unread,
Feb 14, 2012, 3:03:28 AM2/14/12
to
My diff:
+set autolist

-setenv PAGER more
+setenv PAGER less

if ($?prompt) then
# An interactive shell -- set some stuff up
+ set promptchars = '$#'
+ set prompt = "%{^[[50;73;1m%}\[`whoami`@%m %~\]%#%{^[[m%} "


I think 'set autolist' must have everyone.
PAGER is not necessary.
And this is best prompt I think =)

--
View this message in context: http://freebsd.1045724.n5.nabble.com/Enhancing-the-user-experience-with-tcsh-tp5471144p5481784.html
Sent from the freebsd-current mailing list archive at Nabble.com.

Ivan Voras

unread,
Feb 14, 2012, 8:38:24 AM2/14/12
to
On 10/02/2012 17:25, Eitan Adler wrote:

> setenv BLOCKSIZE K

Why note BLOCKSIZE M? It's pretty much ridiculous to count kilobytes
nowadays.

> Many people had alternative suggestions for the prompt. Can you please
> clarify why you believe your prompt should be the _default_ one?

My prompt suggestion:

set prompt="%U%m%u:%B%~%b%# "

It makes the prompt lines clearly and loudly visible in a screen full of
busy commands.


signature.asc

Astrodog

unread,
Feb 14, 2012, 8:19:43 AM2/14/12
to
... snip ...

> if ($?prompt) then
> # An interactive shell -- set some stuff up
> - set prompt = "`/bin/hostname -s`# "
> + set prompt = "[%n@%m]%c04%# "
> + set promptchars = "%#"
>
> Many people had alternative suggestions for the prompt. Can you please
> clarify why you believe your prompt should be the _default_ one?
> While many admins are able to deal with short non-descriptive prompts
> it helps new users to have more detail on the prompt line. I'd like to
> commit some change to the default: currently it is very undescriptive.
> I am leaving open which prompt I am going with at the end though.

Personally, I pay very little attention to the prompt. That being said...
Plenty of people prefer widely different configurations for the prompt.
I think everyone agrees that the default prompt isn't particularly
informative, however, achieving consensus here is going to be almost
impossible. I suggest that it be handled as a seperate discussion,
perhaps?

>
> set filec
> - set history = 100
> - set savehist = 100
> + set history = 10000
> + set savehist = 10000
>
> No one complained about this one - it is almost certainly going to
> stay it the final version.
>
> + set autolist
>
> set autolist=ambiguous makes sense here - I will likely go with that.
>
> + # Use history to aid expansion
> + set autoexpand
>
> No one complained about this - it is almost certainly going to stay
> it the final version.
>
> Now to address some comments made in the thread. I'm sorry for not
> preserving attribution here.
>
>> How about adding stuff like this to /usr/share/examples/tcsh/complete.tcsh ?
>> Along with a comment in .cshrc pointing to that file (or even a commented line to source it), it would be an improvement.
>
> +1 I'll add a comment addressing this file.
>
>> I use the $HOME/bin on my machines but I am not so sure to make this a general thing.
>
> Many people expect it, and given that it is the last item in the path
> it won't affect all that much.

I am against this change, barring a more compelling reason to include
it. Default behavior limits $PATH to areas that are only writable as
root, and there is no garuntee that $HOME can only be written by the
user. As a result, the change may create unanticipated and unnoticed
security consequences some installations. I believe this outweighs the
functionality provided by the proposed change, given how trivial this
is to configure after the fact.

... snip ...

These two issues aside, I do like the idea here. Here's hoping it
doesn't collapse under thousands of coats of paint.

--- Harrison
0 new messages