Tcsh: Difference between revisions
mNo edit summary |
m formatting |
||
| Line 1: | Line 1: | ||
An alternative c-shell | An alternative c-shell. It's also the default shell used by old systems at University of Calgary Computer Science. | ||
== Configuration == | == Configuration == | ||
The {{code|.tcshrc}} file defines the tcsh configuration. An example file follows: | |||
{{highlight|lang=text|code= | |||
# User specific aliases and functions | |||
alias rm 'rm -i' | |||
alias cp 'cp -i' | |||
alias mv 'mv -i' | |||
set prompt = "%m:%~ %h# " | |||
set histfile = ~/.tcsh_history | |||
set autolist | |||
bindkey "\e[1~" beginning-of-line # Home | |||
bindkey "\e[7~" beginning-of-line # Home rxvt | |||
bindkey "\e[2~" overwrite-mode # Ins | |||
bindkey "\e[3~" delete-char # Delete | |||
bindkey "\e[4~" end-of-line # End | |||
bindkey "\e[8~" end-of-line # End rxvt | |||
}} | |||
== Issues == | == Issues == | ||
Tcsh has some annoyances out of the box which is 'fixed' with the changes made to {{code|.tcshrc}} above. Here are what the these changes are: | |||
=== Auto Completion === | === Auto Completion === | ||
The tab key will by default not do anything, unless the following line is in your tcshrc file: | The tab key will by default not do anything, unless the following line is in your tcshrc file: | ||
{{highlight|lang=text|code= | |||
set autolist | |||
}} | |||
=== History Logging === | === History Logging === | ||
Similar to the .bash_history file in bash, you can tell tcsh to log your commands in a file by adding the following to your tcshrc file: | Similar to the .bash_history file in bash, you can tell tcsh to log your commands in a file by adding the following to your .tcshrc file: | ||
{{highlight|lang=text|code= | |||
set histfile = ~/.tcsh_history | |||
}} | |||
=== Remapping Home,End,Delete Keys in tcsh === | === Remapping Home,End,Delete Keys in tcsh === | ||
Add the following to your tcshrc file: | Add the following to your .tcshrc file: | ||
{{highlight|lang=text|code= | |||
bindkey "\e[1~" beginning-of-line # Home | |||
bindkey "\e[7~" beginning-of-line # Home rxvt | |||
bindkey "\e[2~" overwrite-mode # Ins | |||
bindkey "\e[3~" delete-char # Delete | |||
bindkey "\e[4~" end-of-line # End | |||
bindkey "\e[8~" end-of-line # End rxvt | |||
}} | |||
Revision as of 01:22, 6 March 2017
An alternative c-shell. It's also the default shell used by old systems at University of Calgary Computer Science.
Configuration
The .tcshrc file defines the tcsh configuration. An example file follows:
# User specific aliases and functions
alias rm 'rm -i'
alias cp 'cp -i'
alias mv 'mv -i'
set prompt = "%m:%~ %h# "
set histfile = ~/.tcsh_history
set autolist
bindkey "\e[1~" beginning-of-line # Home
bindkey "\e[7~" beginning-of-line # Home rxvt
bindkey "\e[2~" overwrite-mode # Ins
bindkey "\e[3~" delete-char # Delete
bindkey "\e[4~" end-of-line # End
bindkey "\e[8~" end-of-line # End rxvt
Issues
Tcsh has some annoyances out of the box which is 'fixed' with the changes made to .tcshrc above. Here are what the these changes are:
Auto Completion
The tab key will by default not do anything, unless the following line is in your tcshrc file:
set autolist
History Logging
Similar to the .bash_history file in bash, you can tell tcsh to log your commands in a file by adding the following to your .tcshrc file:
set histfile = ~/.tcsh_history
Remapping Home,End,Delete Keys in tcsh
Add the following to your .tcshrc file:
bindkey "\e[1~" beginning-of-line # Home
bindkey "\e[7~" beginning-of-line # Home rxvt
bindkey "\e[2~" overwrite-mode # Ins
bindkey "\e[3~" delete-char # Delete
bindkey "\e[4~" end-of-line # End
bindkey "\e[8~" end-of-line # End rxvt