mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Add default initialization file for zsh ; move scripts to rc/ dir
This commit is contained in:
31
xterm/rc/.zshrc
Normal file
31
xterm/rc/.zshrc
Normal file
@@ -0,0 +1,31 @@
|
||||
# user specific environment
|
||||
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
|
||||
then
|
||||
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
|
||||
fi
|
||||
export PATH
|
||||
|
||||
# don't put duplicate lines in the history
|
||||
HISTCONTROL=ignoredups:ignorespace
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# custom PS1
|
||||
PS1='%F{magenta}%n%f@%F{green}%m%f:%1~%# '
|
||||
|
||||
# user default env config
|
||||
if [ -f ~/.zshenv ]; then
|
||||
. ~/.zshenv
|
||||
fi
|
||||
|
||||
# user default profile config
|
||||
if [ -f ~/.zprofile ]; then
|
||||
. ~/.zprofile
|
||||
fi
|
||||
|
||||
# user default run time config
|
||||
if [ -f ~/.zshrc ]; then
|
||||
. ~/.zshrc
|
||||
fi
|
||||
@@ -40,9 +40,10 @@ my $shelllogin = "-".$shellname;
|
||||
|
||||
# Check for initialization file
|
||||
if ($config{'rcfile'}) {
|
||||
my $rcdir = "$module_root_directory/rc";
|
||||
my $rcfile = $config{'rcfile'} == 1 ?
|
||||
# Load shell init default file from module root directory
|
||||
$module_root_directory."/default-rc_".$shellname :
|
||||
"$rcdir/.".$shellname."rc" :
|
||||
# Load shell init custom file
|
||||
$config{'rcfile'};
|
||||
if ($rcfile =~ /^\~\//) {
|
||||
@@ -56,7 +57,11 @@ if ($config{'rcfile'}) {
|
||||
}
|
||||
# Sh
|
||||
elsif ($shellname eq 'sh') {
|
||||
$shellexec = "ENV=$rcfile; export ENV ; $shellexec";
|
||||
$shellexec = "export ENV=$rcfile ; $shellexec";
|
||||
}
|
||||
# Zsh
|
||||
elsif ($shellname eq 'zsh') {
|
||||
$shellexec = "export ZDOTDIR=$rcdir ; $shellexec";
|
||||
}
|
||||
|
||||
# Cannot use login shell while passing other parameters,
|
||||
|
||||
Reference in New Issue
Block a user