You are not logged in.
Hi,
I must've done something stupid a while ago, cause whenever I sudo -s to get some root privilages it seems .zshrc is not read.
Prompt is default and aliases don't work.
Here's my .zshrc, just in case. I'm quite sure it's okay.
##################################################
# OPTIONS FOR ZSH
#
#
#
# PS1=$'%(!.%{\e[0;31m%}#.%{\e[0;32m%}$)>_ %{\e[0m%}' # $>_ / #>_
#
PS1=$'%(!.%{\e[1;31m%}%{\e[5;31m%}>>>.%{\e[1;31m%}>%{\e[1;33m%}>%{\e[1;32m%}>) %{\e[0m%}' # >>> / >>>
RPS1=$'%{\e[0;33m%}[%~]%{\e[0m%}'
# RPROMPT=$'[~]'
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/opt/mozilla/bin:$HOME/linux/bin:/opt/kde/bin:/opt/java/jre/bin:/usr/local/bin"
export EDITOR="vim"
export MANPATH="/usr/share/man:/usr/man"
export DE=kde
#export TERM=xterm-256color
# key bindings
bindkey -v
bindkey "^[[2~" overwrite-mode
bindkey "^[[3~" delete-char
bindkey "\e[7~" beginning-of-line
bindkey "\e[8~" end-of-line
bindkey "$(echotc kl)" backward-char
bindkey "\E[A" up-line-or-search
bindkey "\E[B" down-line-or-search
bindkey '^R' history-incremental-search-backward
bindkey -M vicmd 'k' up-line-or-search
bindkey -M vicmd 'j' down-line-or-search
HISTFILE=~/.zshhistory
HISTSIZE=50000
SAVEHIST=50000
# aliases
alias ..='cd ..'
alias cl='clear'
alias ls='ls --color=auto'
alias lsl='ls -hl --color=auto'
alias rm='rm -v'
alias pg='pgrep -lf'
alias ka='killall -s 9'
alias sus='sudo -s'
alias hdtemp='sudo hddtemp /dev/sda'
alias du="du -h"
alias df="df -h"
alias freq="cpufreq-info | grep decide"
alias mpdkill="sudo mpd --kill && killall -s 9 mpdscribble"
alias sudo="sudo "
alias nc="ncmpcpp"
alias cmatrix="cmatrix -abu2"
alias x="startx"
alias thinkpad-smapi="thinkpad-smapi -b 0"
alias relap="sudo /etc/rc.d/laptop-mode restart"
alias rewlan="sudo ifconfig wlan0 {down,up}"
alias rentpd="sudo /etc/rc.d/openntpd restart"
alias resamba="sudo /etc/rc.d/samba restart"
alias recups="sudo /etc/rc.d/cups restart"
alias reblue="sudo /etc/rc.d/bluetooth restart"
alias fancool="/etc/rc.d/thinkfan stop && echo level 7 > /proc/acpi/ibm/fan"
alias fanstart="sudo /etc/rc.d/thinkfan start"
# functions
fs() { find $1 -iname '*'$2'*'; }
gcurses() { gcc $1 -o $(cut -d . -f 1 $1) -lncurses;}
ranger () {
command ranger --fail-unless-cd $@ &&
cd "$(grep \^\' ~/.ranger/bookmarks | cut -b3-)"
}
# completion
autoload -U compinit
compinit
# correction
setopt correctall
# prompt
# autoload -U promptinit
# promptinit
# prompt redhat
# options
setopt hist_ignore_all_dups
setopt hist_ignore_space
setopt nohup # don't kill bg jobs when tty quits
setopt nocheckjobs # don't complain about background jobs on exit
#Some functions, like _apt and _dpkg, are very slow. You can use a cache in order to proxy the list of results (like the list of available debian packages) Use a cache:
zstyle ':completion:*' use-cache on
zstyle ':completion:*' cache-path ~/.zsh/cache
#Prevent CVS files/directories from being completed:
zstyle ':completion:*:(all-|)files' ignored-patterns '(|*/)CVS'
#Ignore completion functions for commands you don't have:
zstyle ':completion:*:functions' ignored-patterns '_*'
zstyle ':completion:*:cd:*' ignored-patterns '(*/)#CVS'
zstyle ':completion:*:processes-names' command 'ps -e -o comm='
Last edited by vi3dr0 (2010-09-19 15:10:41)
Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox
Offline
Do you have a .zshrc for root, or only for your user?
Last edited by Mr.Elendig (2010-09-18 13:11:28)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
I never had one for root.
Maybe I'm getting the whole idea of using sudo wrong? I always used sudo -s when I needed root privileges for few things in a row, instead of putting sudo in every command. All my aliases, functions from ~/.zshrc were still working. Prompt also did change, as specified in this file.
Suddenly, some time ago it changed.
Last edited by vi3dr0 (2010-09-18 16:19:04)
Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox
Offline
When you sudo, you become root, so the PS1/PROMPT is read from /root/.zshrc (if it exists) instead of /home/youruser/.zshrc
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Makes sense. However I never had one in /root So why was it working earlier?
Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox
Offline
This took me a while to work out. Put in your /etc/sudoers file this (using the command visudo):
Defaults !env_reset
I put this just under the "## Defaults specification" header, not that it should matter. Let us know if it worked.
Arch x86_64
Offline
Indeed, it's just how it was. Thank you very much
I'm really curious, what has changed and when did it occur?
Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox
Offline
I think this was a pushed /etc/sudoers file that pacdiffviewer prompts you to replace with, maybe a month ago? If you were like me, you probably only added yourself being able to sudo. I don't have the old version, but I don't remember requiring the code I gave you... maybe they've changed something necessitating the new file. Anyway, happy times, my prompt turns red when I 'sudo -s'
Arch x86_64
Offline
Well, actually now that you mentioned I remember that...
Thank you one more time
Thinkpad T61p : T7700 | 4GB RAM | nVidia FX 570M | Intel 4965
Arch64 @ Openbox
Offline