[SOLVED] zsh command is echoed back in tty

When I am in a tty and type a command such as "ls" I get:
$ ls
lsDirectory/
$
instead of
$ ls
Directory/
$
This is an annoyance. It has something to do with an option in my zshrc but I am not sure which one (I tried removing it to verify and yeah that's it). When I am in a terminal inside of X I do not have this issue. It is also not an issue in bash. Here is my .zshrc file:
NOPRECMD=1
function precmd() {
print -Pn "\e]2;%~\a"
preexec () {
print -Pn "\e]2;%~ : $1\a"
# Auto Completion And Additional Settings
autoload -U compinit
compinit
zstyle ':completion:*' menu select
export HISTFILE=~/.zsh_history
export HISTSIZE=50000
export SAVEHIST=50000
eval `dircolors -b`
setopt autopushd pushdminus pushdsilent pushdtohome
setopt autocd
setopt cdablevars
setopt ignoreeof
setopt interactivecomments
setopt nobanghist
#setopt noclobber
setopt HIST_REDUCE_BLANKS
setopt HIST_IGNORE_SPACE
setopt SH_WORD_SPLIT
setopt nohup
setopt completealiases
setopt correct
#setopt correctall
#Colored Prompt
autoload -U promptinit
promptinit
#Colors
autoload -U colors && colors
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
# allow approximate
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric
#zstyle ':completion:*' special-dirs true
#zstyle ':completion:*' accept-exact '*(N)'
zstyle ':completion:*' list-dirs-first true
#Cache
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path ~/.zsh/cache
# tab completion for PID :D
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
#compdef _gnu_generic
#zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq'
compdef _pids cpulimit
compdef _pids ps
compdef _pids appuptime
# cd not select parent dir
zstyle ':completion:*:cd:*' ignore-parents parent pwd
#Special Keys
typeset -g -A key
#bindkey '^[[3' backward-kill-word trying to figure out ctrl+backspace...still
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
bindkey '^?' backward-delete-char
bindkey '^[[1~' beginning-of-line
bindkey '^[[5~' up-line-or-history
bindkey '^[[3~' delete-char
bindkey '^[[4~' end-of-line
bindkey '^[[6~' down-line-or-history
bindkey '^[[A' up-line-or-search
bindkey '^[[D' backward-char
bindkey '^[[B' down-line-or-search
bindkey '^[[C' forward-char
# completion in the middle of a line
bindkey '^i' expand-or-complete-prefix
#Directory Colors
LS_COLORS='rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:';
export LS_COLORS
#History Search
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
source /home/dodo3773/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
#source /home/dodo3773/.zsh/plugins/safe-paste.plugin.zsh
fpath=( $HOME/.zsh/functions $fpath )
PATH=$PATH:/home/dodo3773/Documents/Scripts
DONTSETRPROMPT=1
if [ ${UID} -ne 0 ]; then
PS1="%{%F{white}%}%~ %{%F{green}%}>> %{%f%}"
RPROMPT='%{%F{green}%}[%{%F{red}%}%"%?%{%F{green}%}]'
else
PS1="%{%F{red}%}%~ %{%F{green}%}>> %{%f%}"
RPROMPT='%{%F{green}%}[%{%F{red}%}%"%?%{%F{green}%}]'
fi
Last edited by dodo3773 (2013-05-22 19:08:12)

or `if [[ "$TERM" == "linux" ]];` which has a couple minor advantages.  First it doesn't need to spawn another subprocess, and second, if you ever *do* end up using tmux/screen/fbterm in a tty, then you'll still have the "window" title (tab) set in those envrionments too.
EDIT: my suggested condition is of the opposite logic, so use an else, !, or not-equal comparison.
My bashrc has a number of settings in one good size if/then/else/fi block for settings that should differ between virtual terminals and ttys.  I don't know if you can define functions inside conditionals ... I doubt it, but I guess I've never really tried.  If possible, this would be handy so the conditional doesn't have to be evaluated every time the preexec is called.
Last edited by Trilby (2013-05-22 19:37:44)

Similar Messages

  • Java Communication:COM3 echoing back the commands

    Hi,
    I want to send commands to the internal modem and get a reply. My code does not throw any exceptions. The problem that I am facing is that whatever command I send to COM3(the port on which the modem is connected), I get an echo of the command back. Not only the command but whatever i write to the OutputStream I get it back. Please tell me where I am going wrong.
    I followed the example from here http://java.sun.com/developer/Books/javaprogramming/cookbook/11.pdf.
    I am new to java communication API so need to know why COM3 is echoing back the command instead of responding.
    Here is my code:
    package comm;
    import gnu.io.*;
    import gnu.io.CommPortIdentifier;
    import gnu.io.ParallelPort;
    import java.io.*;
    import java.util.*;
    import java.io.InputStreamReader;
    public class Data {
        public static final int TIMEOUTSECONDS = 30;
        public static final int BAUD = 9600;
        protected boolean debug = true;
         private ParallelPort serialPort;
        private DataInputStream is;
        private PrintStream os;
        static String name;
         static CommPortIdentifier portId;
         static CommPort thePort;
       public static void main(String args[]) throws PortInUseException
                Data d=new Data();
        Enumeration portList = CommPortIdentifier.getPortIdentifiers();
            while(portList.hasMoreElements())
                portId = (CommPortIdentifier)portList.nextElement();
                   System.out.println("Name is:"+portId.getName()+" "+"Owner-"+portId.isCurrentlyOwned() +" "+"TYPE -"+portId.getPortType() );
                    name = portId.getName();
       if(portId.getPortType()== CommPortIdentifier.PORT_SERIAL)
        try
              portId=CommPortIdentifier.getPortIdentifier(name);
            thePort = portId.open("DarwinSys DataComm",
              TIMEOUTSECONDS * 1000);
         SerialPort myPort = (SerialPort) thePort;
         myPort.setSerialPortParams(BAUD, SerialPort.DATABITS_8,
          SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
            } catch(Exception e)
            e.printStackTrace();
        try {
    d.is = new DataInputStream(thePort.getInputStream());
    d.os = new PrintStream(thePort.getOutputStream(), true);
    d.os.print("ATZ");
    d.os.print("\r\n");
    String response = d.is.readLine();
    System.out.println("Response on port:"+""+name+": "+response+""+"OwnedBy--"+portId.getCurrentOwner());
    catch(Exception e)
    {e.printStackTrace();}
    }thanks for you help in advance
    regards
    Protozoa
    Edited by: protozoa on Aug 20, 2008 4:01 AM

    Hi,
    Just an update on the previous post, when I sent "ATE0" it stopped echoing. BUT when I send another command it sends back null now.
    here is the updated code:
    d.os.print("ATE0");
    Thread.currentThread().sleep(500);
    d.os.print("ATZ");
    Thread.currentThread().sleep(500);
    d.os.print("\r\n");
    String response = d.is.readLine();
    System.out.println("Response on port:"+""+portId.getName()+": "+response+""+"OwnedBy--"+portId.getCurrentOwner());If I only send "ATE0" nothing is displayed, but when I sent "ATZ" next it retruns null.
    regards
    Protozoa

  • What is 11.0.3 doing to my laptop to ECHO back NUMBERS in place of LETTERS?

    1. Environment: Windows 7, Adobe Reader 11.0.2 or 11.0.3, IE 10 or FoxFire Mozilla, MS Word2010.
    LOCAL
    2.1 Action Sequence #1: Launch .pdf file locally from "C" drive; view .pdf, EXIT.
    2.2                                    :  Launch MSWord2010, type "HELLO", SCREEN ECHOs BACK NUMBERS RANDOMLY - NOT "HELLO".
    VIA IE
    3.1 Action Sequence #2: Lauch .pdf file located via Google search; view .pdf, EXIT.
    3.2                                     : Type "HELLO" into Google search box, SCREEN ECHOs BACK NUMBERS RANDOMLY - NOT "HELLO".
    4 Any combo of local/IE view of a .pdf and local/IE typing (except NOTEPAD) results in above behavior.
    5. ONLY SOLUTION IS REBOOT - A PAIN.
    THIS IS THIRD TIME I'M POSING QUESTION AS I'VE RECEIVED NO DIRECTION. PROBLEM IS CLEAR. WHAT IS GOING ON?

    You're free to go all the way back to 10 if you feel so inclined... But I've read more than a dozen different support forums including at least three at laptop manufacturers' sites (and even Microsoft) which ALL say this is a numlock problem fixable from the keyboard.
    http://answers.microsoft.com/en-us/windows/forum/windows_vista-hardware/my-laptop-keyboard-types-numbers-instead-of/ed 246377-9594-4040-82af-b4ef0f076c92
    http://www.makeuseof.com/answers/asus-netbook-writing-numbers-letters/
    http://www.techsupportforum.com/forums/f108/solved-keyboard-types-numbers-instead-of-lette rs-168083.html
    http://www.fixya.com/support/t2353787-laptop_keyboard_typing_numbers_instead
    http://www.tomshardware.com/forum/57347-35-help-keys-type-numbers-letters
    http://answers.yahoo.com/question/index?qid=20110531185202AAFiUFK
    http://www.knowhow.com/article.dhtml?articleReference=582
    http://www.pchelpforum.com/xf/threads/keyboard-typing-numbers-instead-of-letters.91591/
    http://forums.toshiba.com/t5/Keyboards-Touchpads/Keyboard-typing-numbers-instead-of-letters/td-p/195460
    http://forum.notebookreview.com/sony/565545-some-letters-keyboard-typing-numbers-instead-letters.html
    http://wiki.answers.com/Q/How_do_you_stop_your_keyboard_from_typing_numbers_instead_of_let ters
    http://skp.samsungcsportal.com/integrated/popup/FaqDetailPopupMobile.jsp?cdsite=ie&seq=150973
    NOT ONE OF THOSE LINKS says ANYTHING AT ALL about removing Adobe reader as any part of the solution that WORKED for what I can only assume are hundreds of others having the same issue.
    I can say with a strong degree of certainty that this IS NOT a Reader ISSUE and Reader IS NOT the cause.

  • Zsh: command not found?

    I've had some issues getting terminal to work after some problems a while back. You can read more on my issues in this post.
    http://discussions.apple.com/thread.jspa?messageID=3905356?
    The error message is "zsh: command not found: wget" What does this mean?
    I've been unable to dig up any information online about the error message I get when attempting to use fink and wget. What has happened and how can I fix it?
    I'm attempting to use wget and I know it has been installed properly but I'm not able to start it. What should I do to fix this problem?

    There are four unix shells that come with OS X. One of them is zsh. In 10.3 and 10.4, the default shell is bash. Prior to that it was tcsh. (ksh is also present).
    Is it possible that you used to use bash and switched somehow to zsh?
    If you want to switch to bash, just issue
    chsh -s /bin/bash
    If you want to switch to tcsh, just issue
    chsh -s /bin/tcsh
    If you are ok using zsh, then you want to make sure that you have zsh configured the way you want to. We can help you do that too, (or help with whichever shell you are most comfortable using).
    If you installed wget with fink, you just need to issue the command
    /sw/bin/init.sh
    if you are using bash or zsh, and issue
    /sw/bin/init.csh
    if you are using tcsh.
    If you installed wget into /usr/local/bin, then you need to add that to your $PATH.

  • What is command to bring back the standby database to primary database?

    what is command to bring back the standby database to primary database?
    Please reply soon....

    Mariappan wrote:
    no i am not using dgbroker...Please don't make me drag everything out of you. If you only answer one question at a time, this is going to take much longer and I'm going to find better things to do with my time.
    One more time: Have you read the documentation - http://download.oracle.com/docs/cd/B10501_01/server.920/a96653/role_management.htm#1033701

  • [SOLVED]zsh and variables?

    hello,
    is there possibility to export global(local) variables with spaces between names?
    now my shell only export first part of variable, to space
    regards
    Last edited by falomir (2009-08-18 04:33:00)

    --> zsh
    --> export test=$(echo one two three)
    --> echo $test
    one
    --> export test="$(echo one two three)"
    --> echo $test
    one two three
    --> bash
    --> export test=$(echo one two three)
    --> echo $test
    one two three
    --> exit
    A bug maybe?
    var=$(..) should work without quotes
    --> test=$(echo one two three)
    --> export test
    --> echo $test
    one two three

  • [SOLVED] lirc: command not found

    Hello everyone,
    I have an old MCE remote that i'd like to make use of. I've been trying to follow the archwiki, everything is good I installed LIRC and LIRC-utils, loaded lirc_mceusb, except for the part where I'm supposed to execute lirc for some reason I get an invalid command error even thought its installed. Am I missing something here?
    archuser@archws ~ % lirc                                                 <12:32>
    zsh: correct 'lirc' to 'lircd' [nyae]? n
    zsh: command not found: lirc
    Last edited by aluser (2011-02-26 04:22:25)

    The mceusb module ships with the kernel now, so the lirc package is no longer necessary.  Simple initial setup:
    Install lirc-utils
    Copy /usr/share/lirc/remotes/mceusb/lircd.conf.mceusb to /etc/lirc/lircd.conf
    Edit /etc/rc.conf and add mceusb to the MODULES array and lircd to the DAEMONS array
    Edit /etc/rc.local and add
    /usr/bin/ir-keytable -p lirc
    Create ~/.lircrc and edit as required
    Reboot
    If double keystrokes are the problem now and you have a dib0700-based dvb card installed then create /etc/modprobe.d/dvb-usb.conf containing
    options dvb_usb disable_rc_polling=1
    I've got a model 1039 with the colour buttons and it works fine:
    $ irw
    000000037ff07be8 00 Record mceusb
    000000037ff07be8 01 Record mceusb
    000000037ff07be9 00 Play mceusb
    000000037ff07be9 01 Play mceusb
    000000037ff07beb 00 Forward mceusb
    000000037ff07beb 01 Forward mceusb
    000000037ff07beb 02 Forward mceusb
    000000037ff07bdd 00 OK mceusb
    000000037ff07bdd 01 OK mceusb
    000000037ff07bdd 02 OK mceusb
    000000037ff07be0 00 Down mceusb
    000000037ff07be0 01 Down mceusb
    Edit: Missed a step.
    Edit: Missed a hardware-specific step.
    Last edited by azleifel (2011-02-15 21:02:56)

  • Zsh: command not found: wifi-menu

    I'm trying to connect to wireless during setup but I keep getting the error: zsh: command not found: wifi-menu

    I think so... but I don't really know for sure.  I am fairly certain it was just an oversight this month. Interestingly, all the other things that netctl depend on are in there... just not netctl itself.  Go to the wireless page of the wiki and there are step by step instructions there (you just have to scroll past all the vendor specific info).  In short, you use wpa_passphrase to generate a wpa_supplicant.conf and then use wpa_supplicant to associate, then use dhcpcd (or dhclient) to get an IP address.  It is pretty simple once you do it once or twice.

  • [SOLVED] zsh config (.zshrc) no longer working for root.

    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)

    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'

  • [SOLVED] zsh start up issue

    When I open a new zsh session it is listing all aliases known to it.
    the only change is placing my aliases in a separate file & sourcing it in my ~/.zsrch
    even if I put the aliases back in the .zsrc file the same behaviour occurs.
    Is this trying to tell me I have syntax issue's or too many ???
    I only ask because it is just dumping them all to stdout upon startup (including ones I never knew I had!) without error & the aliases still work.
    here is what it looks like:
    ...='cd ../../'
    aur='pacaur -y'
    auri='pacaur -ii'
    aurs='pacaur -s'
    aurup='pacaur -u'
    aurupc='pacaur -k'
    config='git --git-dir=/home/t0m5k1/.arch-config.git/ --work-tree=/home/t0m5k1'
    cpuinfo=lscpu
    da='du -sch'
    dir='ls --color=auto --format=vertical'
    dnstop='sudo dnstop -l 5 eth1'
    egrep='egrep --color=auto'
    ethtool='sudo ethtool eth1'
    fgrep='fgrep --color=auto'
    grep='grep --color=auto'
    help-zshglob=H-Glob
    iftop='sudo iftop -i eth1'
    insecscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
    insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
    j='jobs -l'
    keep='noglob keep'
    l='ls -CF'
    la='ls -Al'
    lad='ls -d .*(/)'
    lc='ls -lcr'
    lh='ls -hAl --color=auto'
    lk='ls -lSr'
    ll='ls -l'
    lm='ls -al |more'
    lr='ls -lR'
    ls='ls -hF --color'
    lsa='ls -a .*(.)'
    lsbig='ls -flh *(.OL[1,10])'
    lsd='ls -d *(/)'
    lse='ls -d *(/^F)'
    lsl='ls -l *(@)'
    lsnew='ls -rtlh *(D.om[1,10])'
    lsnewdir='ls -rthdl *(/om[1,10]) .*(D/om[1,10])'
    lsold='ls -rtlh *(D.Om[1,10])'
    lsolddir='ls -rthdl *(/Om[1,10]) .*(D/Om[1,10])'
    lss='ls -l *(s,S,t)'
    lssmall='ls -Srl *(.oL[1,10])'
    lsw='ls -ld *(R,W,X.^ND/)'
    lsx='ls -l *(*)'
    lt='ls -ltr'
    lu='ls -lur'
    lx='ls -lXB'
    mdstat='cat /proc/mdstat'
    meminfo='free -m -l -t'
    new=modified
    nn=nano
    nocomment='sudo grep -Ev '\''\'\'\''^(#|$)'\''\'\'\'
    ns='sudo netstat -alnp --protocol=inet | less'
    pac='sudo pacman -S'
    pacc='sudo pacman -Sc'
    pacf='sudo pacman -Ql'
    paci='sudo pacman -Sii'
    pacl='sudo pacman -Sl'
    pacld='sudo pacman -Qi'
    pacll='sudo pacman -Qqm'
    paclo='sudo pacman -Qdt'
    pacm='sudo makepkg -fci'
    paco='sudo pacman -Qo'
    pacp='sudo pacman -Rns'
    pacr='sudo pacman -Rs'
    pacs='sudo pacman -Ss'
    pacu='sudo pacman -Syu'
    ports='sudo netstat -nape --inet | less'
    poweroff='sudo power off'
    pscpu='ps auxf | sort -nr -k 3'
    pscpu10='ps auxf | sort -nr -k 3 | head -10'
    psmem='ps auxf | sort -nr -k 4'
    psmem10='ps auxf | sort -nr -k 4 | head -10'
    reboot='sudo reboot'
    rmcdir='cd ..; rmdir $OLDPWD || cd $OLDPWD'
    root='sudo sudo -s'
    scat='sudo cat'
    screen='/usr/bin/screen -c /home/t0m5k1/.screenrc'
    se=simple-extract
    sless='sudo less'
    snan='sudo nano'
    svim='sudo vim'
    tcpdump='sudo tcpdump -i eth1'
    term2iso='echo '\''Setting terminal to iso mode'\'' ; print -n '\''\e%@'\'
    term2utf='echo '\''Setting terminal to utf-8 mode'\''; print -n '\''\e%G'\'
    tree='tree -Csu'
    url-quote='autoload -U url-quote-magic ; zle -N self-insert url-quote-magic'
    vdir='ls --color=auto --format=long'
    vi=vim
    vnstat='sudo vnstat -i eth1'
    which-command=whence
    ┌─(t0m5k1@b0x)-(2065/pts/0)-(04:13pm:16/07/13)-
    └─>(%:~)
    └─>>
    I see this in a new window or even if I start zsh from a bash session.
    any clues here
    ADDITIONAL INFO:
    packages used relating to ZSH:
    extra/grml-zsh-config 0.8.2-1 [installed]
    grml's zsh setup
    extra/zsh 5.0.2-2 [installed]
    A very advanced and programmable command interpreter (shell) for UNIX
    community/zsh-lovers 0.8.3-2 [installed]
    A collection of tips, tricks and examples for the Z shell.
    Config files:
    my .zsrc & alias file
    http://sprunge.us/YAQR
    unedited /etc/zsh/zshrc
    http://sprunge.us/IOJY
    Last edited by t0m5k1 (2013-07-16 15:50:58)

    Trilby wrote: Given that there seems to be *several* hundred lines there (do you use all that?)
    lol yea got fed up with searching my history!
    Trilby wrote: rename/move the configs, and restart zsh - is the problem gone?  If so, start adding things back little by little: add back the first half of the config, is the problem still there?  etc, etc.
    yup just decided to do that & have found 2 possible issue's
    1) changed all " for ' to follow the same syntax as /etc/zsh/zshrc
    2) found a blank alias so removed it
    all working thanks trilby for pointers/logic & wonderwoofy for pointing out the lack of info

  • [SOLVED]ZSH and regular expressions

    Hi
    I am getting into regular expressions and i have noticed that with my .zshrc file i have some problem. In bash this expression works:
    \^\[^#]
    but not also in zsh. I have also noted that regular expression works fine with other zshrc configurations found in archwiki (like grml) but i want to have my configuration. And i really can't find what command make a difference
    My .zshrc file is pulled from this site https://github.com/slashbeast/things/bl … s/DOTzshrc.
    # .zshrc
    # Author: Piotr Karbowski <[email protected]>
    # License: beerware.
    # Basic zsh config.
    umask 077
    ZDOTDIR=${ZDOTDIR:-${HOME}}
    ZSHDDIR="${HOME}/.config/zsh.d"
    HISTFILE="${ZDOTDIR}/.zsh_history"
    HISTSIZE='10000'
    SAVEHIST="${HISTSIZE}"
    export EDITOR="/usr/bin/vim"
    export TMP="$HOME/tmp"
    export TEMP="$TMP"
    export TMPDIR="$TMP"
    export TMPPREFIX="${TMPDIR}/zsh"
    if [ ! -d "${TMP}" ]; then mkdir "${TMP}"; fi
    if ! [[ "${PATH}" =~ "^${HOME}/bin" ]]; then
    export PATH="${HOME}/bin:${PATH}"
    fi
    # Not all servers have terminfo for rxvt-256color. :<
    if [ "${TERM}" = 'rxvt-256color' ] && ! [ -f '/usr/share/terminfo/r/rxvt-256color' ] && ! [ -f '/lib/terminfo/r/rxvt-256color' ] && ! [ -f "${HOME}/.terminfo/r/rxvt-256color" ]; then
    export TERM='rxvt-unicode'
    fi
    # Colors.
    red='\e[0;31m'
    RED='\e[1;31m'
    green='\e[0;32m'
    GREEN='\e[1;32m'
    yellow='\e[0;33m'
    YELLOW='\e[1;33m'
    blue='\e[0;34m'
    BLUE='\e[1;34m'
    purple='\e[0;35m'
    PURPLE='\e[1;35m'
    cyan='\e[0;36m'
    CYAN='\e[1;36m'
    NC='\e[0m'
    # Functions
    if [ -f '/etc/profile.d/prll.sh' ]; then
    . "/etc/profile.d/prll.sh"
    fi
    run_under_tmux() {
    # Run $1 under session or attach if such session already exist.
    # $2 is optional path, if no specified, will use $1 from $PATH.
    # If you need to pass extra variables, use $2 for it as in example below..
    # Example usage:
    # torrent() { run_under_tmux 'rtorrent' '/usr/local/rtorrent-git/bin/rtorrent'; }
    # mutt() { run_under_tmux 'mutt'; }
    # irc() { run_under_tmux 'irssi' "TERM='screen' command irssi"; }
    # There is a bug in linux's libevent...
    # export EVENT_NOEPOLL=1
    command -v tmux >/dev/null 2>&1 || return 1
    if [ -z "$1" ]; then return 1; fi
    local name="$1"
    if [ -n "$2" ]; then
    local file_path="$2"
    else
    local file_path="command ${name}"
    fi
    if tmux has-session -t "${name}" 2>/dev/null; then
    tmux attach -d -t "${name}"
    else
    tmux new-session -s "${name}" "${file_path}" \; set-option status \; set set-titles-string "${name} (tmux@${HOST})"
    fi
    t() { run_under_tmux rtorrent; }
    irc() { run_under_tmux irssi "TERM='screen' command irssi"; }
    over_ssh() {
    if [ -n "${SSH_CLIENT}" ]; then
    return 0
    else
    return 1
    fi
    reload () {
    exec "${SHELL}" "$@"
    confirm() {
    local answer
    echo -ne "zsh: sure you want to run '${YELLOW}$@${NC}' [yN]? "
    read -q answer
    echo
    if [[ "${answer}" =~ ^[Yy]$ ]]; then
    command "${=1}" "${=@:2}"
    else
    return 1
    fi
    confirm_wrapper() {
    if [ "$1" = '--root' ]; then
    local as_root='true'
    shift
    fi
    local runcommand="$1"; shift
    if [ "${as_root}" = 'true' ] && [ "${USER}" != 'root' ]; then
    runcommand="sudo ${runcommand}"
    fi
    confirm "${runcommand}" "$@"
    poweroff() { confirm_wrapper --root $0 "$@"; }
    reboot() { confirm_wrapper --root $0 "$@"; }
    hibernate() { confirm_wrapper --root $0 "$@"; }
    detox() {
    if [ "$#" -ge 1 ]; then
    confirm detox "$@"
    else
    command detox "$@"
    fi
    has() {
    local string="${1}"
    shift
    local element=''
    for element in "$@"; do
    if [ "${string}" = "${element}" ]; then
    return 0
    fi
    done
    return 1
    begin_with() {
    local string="${1}"
    shift
    local element=''
    for element in "$@"; do
    if [[ "${string}" =~ "^${element}" ]]; then
    return 0
    fi
    done
    return 1
    termtitle() {
    case "$TERM" in
    rxvt*|xterm|nxterm|gnome|screen|screen-*)
    local prompt_host="${(%):-%m}"
    local prompt_user="${(%):-%n}"
    local prompt_char="${(%):-%~}"
    case "$1" in
    precmd)
    printf '\e]0;%s@%s: %s\a' "${prompt_user}" "${prompt_host}" "${prompt_char}"
    preexec)
    printf '\e]0;%s [%s@%s: %s]\a' "$2" "${prompt_user}" "${prompt_host}" "${prompt_char}"
    esac
    esac
    git_check_if_worktree() {
    # This function intend to be only executed in chpwd().
    # Check if the current path is in git repo.
    # We would want stop this function, on some big git repos it can take some time to cd into.
    if [ -n "${skip_zsh_git}" ]; then
    git_pwd_is_worktree='false'
    return 1
    fi
    # The : separated list of paths where we will run check for git repo.
    # If not set, then we will do it only for /root and /home.
    if [ "${UID}" = '0' ]; then
    # running 'git' in repo changes owner of git's index files to root, skip prompt git magic if CWD=/home/*
    git_check_if_workdir_path="${git_check_if_workdir_path:-/root:/etc}"
    else
    git_check_if_workdir_path="${git_check_if_workdir_path:-/home}"
    git_check_if_workdir_path_exclude="${git_check_if_workdir_path_exclude:-${HOME}/_sshfs}"
    fi
    if begin_with "${PWD}" ${=git_check_if_workdir_path//:/ }; then
    if ! begin_with "${PWD}" ${=git_check_if_workdir_path_exclude//:/ }; then
    local git_pwd_is_worktree_match='true'
    else
    local git_pwd_is_worktree_match='false'
    fi
    fi
    if ! [ "${git_pwd_is_worktree_match}" = 'true' ]; then
    git_pwd_is_worktree='false'
    return 1
    fi
    # todo: Prevent checking for /.git or /home/.git, if PWD=/home or PWD=/ maybe...
    # damn annoying RBAC messages about Access denied there.
    if [ -d '.git' ] || [ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" = 'true' ]; then
    git_pwd_is_worktree='true'
    git_worktree_is_bare="$(git config core.bare)"
    else
    unset git_branch git_worktree_is_bare
    git_pwd_is_worktree='false'
    fi
    git_branch() {
    git_branch="$(git symbolic-ref HEAD 2>/dev/null)"
    git_branch="${git_branch##*/}"
    git_branch="${git_branch:-no branch}"
    git_dirty() {
    if [ "${git_worktree_is_bare}" = 'false' ] && [ -n "$(git status --untracked-files='no' --porcelain)" ]; then
    git_dirty='%F{green}*'
    else
    unset git_dirty
    fi
    precmd() {
    # Set terminal title.
    termtitle precmd
    if [ "${git_pwd_is_worktree}" = 'true' ]; then
    git_branch
    git_dirty
    git_prompt=" %F{blue}[%F{253}${git_branch}${git_dirty}%F{blue}]"
    else
    unset git_prompt
    fi
    preexec() {
    # Set terminal title along with current executed command pass as second argument
    termtitle preexec "${(V)1}"
    chpwd() {
    git_check_if_worktree
    man() {
    if command -v vimmanpager >/dev/null 2>&1; then
    PAGER="vimmanpager" command man "$@"
    else
    command man "$@"
    fi
    # Are we running under grsecurity's RBAC?
    rbac_auth() {
    local auth_to_role='admin'
    if [ "${USER}" = 'root' ]; then
    if ! grep -qE '^RBAC:' "/proc/self/status" && command -v gradm > /dev/null 2>&1; then
    echo -e "\n${BLUE}*${NC} ${GREEN}RBAC${NC} Authorize to '${auth_to_role}' RBAC role."
    gradm -a "${auth_to_role}"
    fi
    fi
    #rbac_auth
    # Check if we started zsh in git worktree, useful with tmux when your new zsh may spawn in source dir.
    git_check_if_worktree
    if [ "${git_pwd_is_worktree}" = 'true' ]; then
    git_branch
    git_dirty
    git_prompt=" %F{blue}[%F{253}${git_branch}${git_dirty}%F{blue}]"
    else
    unset git_prompt
    fi
    # Le features!
    # extended globbing, awesome!
    setopt extendedGlob
    # zmv - a command for renaming files by means of shell patterns.
    autoload -U zmv
    # zargs, as an alternative to find -exec and xargs.
    autoload -U zargs
    # Turn on command substitution in the prompt (and parameter expansion and arithmetic expansion).
    setopt promptsubst
    # Control-x-e to open current line in $EDITOR, awesome when writting functions or editing multiline commands.
    autoload -U edit-command-line
    zle -N edit-command-line
    bindkey '^x^e' edit-command-line
    # Include user-specified configs.
    if [ ! -d "${ZSHDDIR}" ]; then
    mkdir -p "${ZSHDDIR}" && echo "# Put your user-specified config here." > "${ZSHDDIR}/example.zsh"
    fi
    for zshd in $(ls -A ${HOME}/.config/zsh.d/^*.(z)sh$); do
    . "${zshd}"
    done
    # Completion.
    autoload -Uz compinit
    compinit
    zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
    zstyle ':completion:*' completer _expand _complete _ignored _approximate
    zstyle ':completion:*' menu select=2
    zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
    zstyle ':completion::complete:*' use-cache 1
    zstyle ':completion:*:descriptions' format '%U%F{cyan}%d%f%u'
    # If running as root and nice >0, renice to 0.
    if [ "$USER" = 'root' ] && [ "$(cut -d ' ' -f 19 /proc/$$/stat)" -gt 0 ]; then
    renice -n 0 -p "$$" && echo "# Adjusted nice level for current shell to 0."
    fi
    # Fancy prompt.
    if over_ssh && [ -z "${TMUX}" ]; then
    prompt_is_ssh='%F{blue}[%F{red}SSH%F{blue}] '
    elif over_ssh; then
    prompt_is_ssh='%F{blue}[%F{253}SSH%F{blue}] '
    else
    unset prompt_is_ssh
    fi
    case $USER in
    root)
    PROMPT='%B%F{cyan}%m%k %(?..%F{blue}[%F{253}%?%F{blue}] )${prompt_is_ssh}%B%F{blue}%1~${git_prompt}%F{blue} %# %b%f%k'
    PROMPT='%B%F{blue}%n@%m%k %(?..%F{blue}[%F{253}%?%F{blue}] )${prompt_is_ssh}%B%F{cyan}%1~${git_prompt}%F{cyan} %# %b%f%k'
    esac
    # Ignore lines prefixed with '#'.
    setopt interactivecomments
    # Ignore duplicate in history.
    setopt hist_ignore_dups
    # Prevent record in history entry if preceding them with at least one space
    setopt hist_ignore_space
    # Nobody need flow control anymore. Troublesome feature.
    #stty -ixon
    setopt noflowcontrol
    # Fix for tmux on linux.
    case "$(uname -o)" in
    'GNU/Linux')
    export EVENT_NOEPOLL=1
    esac
    # Aliases
    alias cp='cp -iv'
    alias rcp='rsync -v --progress'
    alias rmv='rsync -v --progress --remove-source-files'
    alias mv='mv -iv'
    alias rm='rm -iv'
    alias rmdir='rmdir -v'
    alias ln='ln -v'
    alias chmod="chmod -c"
    alias chown="chown -c"
    if command -v colordiff > /dev/null 2>&1; then
    alias diff="colordiff -Nuar"
    else
    alias diff="diff -Nuar"
    fi
    alias grep='grep --colour=auto'
    alias egrep='egrep --colour=auto'
    alias ls='ls --color=auto --human-readable --group-directories-first --classify'
    # Keys.
    case $TERM in
    rxvt*|xterm*)
    bindkey "^[[7~" beginning-of-line #Home key
    bindkey "^[[8~" end-of-line #End key
    bindkey "^[[3~" delete-char #Del key
    bindkey "^[[A" history-beginning-search-backward #Up Arrow
    bindkey "^[[B" history-beginning-search-forward #Down Arrow
    bindkey "^[Oc" forward-word # control + right arrow
    bindkey "^[Od" backward-word # control + left arrow
    bindkey "^H" backward-kill-word # control + backspace
    bindkey "^[[3^" kill-word # control + delete
    linux)
    bindkey "^[[1~" beginning-of-line #Home key
    bindkey "^[[4~" end-of-line #End key
    bindkey "^[[3~" delete-char #Del key
    bindkey "^[[A" history-beginning-search-backward
    bindkey "^[[B" history-beginning-search-forward
    screen|screen-*)
    bindkey "^[[1~" beginning-of-line #Home key
    bindkey "^[[4~" end-of-line #End key
    bindkey "^[[3~" delete-char #Del key
    bindkey "^[[A" history-beginning-search-backward #Up Arrow
    bindkey "^[[B" history-beginning-search-forward #Down Arrow
    bindkey "^[Oc" forward-word # control + right arrow
    bindkey "^[Od" backward-word # control + left arrow
    bindkey "^H" backward-kill-word # control + backspace
    bindkey "^[[3^" kill-word # control + delete
    esac
    bindkey "^R" history-incremental-pattern-search-backward
    bindkey "^S" history-incremental-pattern-search-forward
    if [ -f ~/.alert ]; then cat ~/.alert; fi
    Thanks for all the help.
    Last edited by Shark (2013-05-11 22:32:24)

    Raynman wrote:
    "This expression doesn't work", "It doesn't work" ...
    Could you try being a bit more specific?
    Firstly, i am sorry i didn't post the output. I should have know better.
    Secondly, chill out.
    I have used above regex with grep command. Output from terminal is:
    zsh: bad pattern: ^[^#]
    In bash it works perfectly.
    If i issue "setopt re_match_pcre" i have the same ouput as above.
    EDIT: If i issue "unsetopt no_match" it actually works but i have to change the regex from "\^\[^#]" to "\^[^#]" otherwise i get the same output as above. In bash both options work.
    Last edited by Shark (2013-05-11 22:07:21)

  • [Solved] Date command not working, maxing out memory and cpu.

    So I've encountered and incredibly strange problem.
    Today, I was working on a script for my bar panel. I was following z3bra's guide "Meeting at The Bar Really simple stuff, nothing harmful:
    #! /bin/sh
    # Fox - do whatever
    # Gathers various info to be displayed on a panel using BAR
    clock () {
    date '+%a %y/%m/%d %I:%M'
    volume () {
    sed -n 's/^.*\[\([0-9]\+\)%.*$/\1%/p'
    cpuload () {
    mpstat 1 1 | awk '$3 ~ /CPU/ { for(i=1;i<=NF;i++) { if ($i ~ /%idle/) field=i } } $3 ~ /all/ { print 100 - $field }'
    memused() {
    read t f <<< `grep -E 'Mem(Total|Free)' /proc/meminfo |awk '{print $2}'`
    bc <<< "scale=2; 100 - $f / $t * 100" | cut -d. -f1
    network() {
    #The Following assumes you have 3 interfaces: loopback, ethernet, wifi
    read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'`
    # iwconfig returns an error code if the interface tested has no wireless
    # extensions
    if iwconfig $int1 >/dev/null 2>&1; then
    wifi=$int1
    eth0=$int2
    else
    wifi=$int2
    eth0=$int1
    fi
    # in case you have only one interface, just set it here:
    # int=eth0
    # this line will set the variable $int to $eth0 if it's up, and $wifi
    # otherwise. I assume that if ethernet is UP, then it has priority over
    # wifi. If you have a better idea, please share :)
    ip link show $eth0 | grep 'state UP' >/dev/null && int=$eth0 || int=$wifi
    #This is now the time to see if network is up or not. For that, a simple ping would do the trick:
    # just output the interface name. Could obviously be done in the 'ping'
    # query
    echo -n "$int"
    # Send a single packet, to speed up the test. I use google's DNS 8.8.8.8,
    # but feel free to use any ip address you want. Be sure to put an IP, not a
    # domain name. You'll bypass the DNS resolution that can take some precious
    # miliseconds ;)
    ping -c 1 8.8.8.8 >/dev/null 2>&1 && echo "connected" || echo "disconnected"
    groups() {
    cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3+1}'`
    tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
    # Desktop numbers start at 0. if you want desktop 2 to be in second place,
    # start counting from 1 instead of 0. But wou'll lose a group
    for w in `seq 1 $((cur - 1))`; do line="${line}="; done
    # enough =, let's print the current desktop
    line="${line}|"
    # En then the other groups
    for w in `seq $((cur + 2)) $tot`; do line="${line}="; done
    # don't forget to print that line!
    if (($cur < "10"))
    then echo $line=
    else echo $line
    fi
    nowplaying() {
    cur=`mpc current`
    test -n "$cur" && echo $cur || echo "- stopped -"
    # This loop will fill a buffer with our infos, and output it to stdout.
    while :; do
    buf=""
    buf="${buf} [$(groups)] -- "
    buf="${buf} CLK: $(clock) -"
    buf="${buf} NET: $(network) -"
    buf="${buf} CPU: $(cpuload)%% -"
    buf="${buf} RAM: $(memused)%% -"
    buf="${buf} VOL: $(volume)%%"
    buf="${buf} MPD: $(nowplaying)"
    echo $buf
    # use `nowplaying scroll` to get a scrolling output!
    sleep 1 # The HUD will be updated every second
    done
    Once I finished it up, I ran it, and nothing happened. So I took a break, and then came back to troubleshoot it. I ran
    bash -x panel.sh
    and didn't see anything weird so I started to just run each command and make sure my syntax was alright. However, right away when I ran date, no output was generated and within seconds my computer came to a crawl, so I rebooted manually.
    Now, whenever I simply run (without any parameters)
    date
    the exact same thing happens and within seconds htop reports 100% memory usage and nearly 100% CPU usage on all four cores. Luckily, if I'm fast enough, ctrl-c still ends the operation of date.
    I've tried reinstalling coreutils,but that doesn't seem to fix the problem and I can't completely remove it first since a lot of things depend on it.. I have no clue how to even start fixing this. Anyone have an idea?
    Realized where I went stupid, in my ~/Scripts folder, I made a script named date without remember that I had recently added that folder to my PATH. So I created a recursive loop that within seconds would crash my computer... oops.
    Last edited by FoxzTrot (2015-02-08 04:00:24)

    I have found the solution! I post how I managed in case someone else has the same issue.
    You have to go to "Settings" -> "Settings Editor".
    There, there is a "display" entry.
    When you open the tree, you can see both of your displays (in my case, LVDS1 and VGA1).
    Under VGA1 (the "extra" monitor), there is a "Position" entry. There, you need to set the "X" variable to the last pixel of the other display resolution.
    E.g.: if you principal display is a "1366x768", then the "X" value will be 1366.
    You can also play on the "Y" if your screens are not horizontally aligned, but 0 should be fine.
    I hope this helps :-)

  • How to get my Command-SHIFT-3 back to snap shot desktop???

    Is there a way to set this?
    I installed a video free-war/shareware program and change it to command (Apple) Shift 4, the default is the same except commandshift3, the same used to snapshot the desk. I can no longer take snap shots of the desktop, although I am glad I learned about COMMANDSHIFT4 (size of what you want, now I don't have to edit images), but would like to have my defaults back.
    The program is SnapZ Pro, captures audio/video. Not as smooth as iSHOWu but IshowU for some reasons DOES NOT capture audio from programs (FCP, DVD Pro, Garage Band, etc...). just the mic works. Trying to solve that too as iSHOWu seems to render quicker and is a tad bit smoother and easier to use.
    Thanks!
    If there are others out there (trials), I would like to try them.
    I don't like the big GREEN TRIAL on the video from iSHOWu, that is lame, makes me want to look for one for free, but its only $20.00 but it doesn't work (capturing program sounds) whereas SnapZ Pro does. Are there others I can try?
    Anyway, how to I get my AppleShift3 back to capture screens (dual). Thanks you guys!

    First things first!
    I don't think I asked correctly!
    I installed it, made the changes to APPLESHIFT2, now my APPLE+SHIFT=3 no longer, as in IT NOT LONGER SNAP SHOTS MY DESKTOP is not working, so is there a way to fix this?
    Also, with all the codecs and compressions I am wondering why iSHOWu which is located here:
    http://www.shinywhitebox.com/home/home.html
    And am having some problems capturing PROGRAM sounds NOT mic, but anyway, once you are down the file renders even if its 3-6 minutes long.
    This program, the one you like TAKES forever to render!
    What compressions are they using at lynda.com for there training modules?!?!
    How can they have something that is 15.03 minutes, looks great and is 26.2 MB whereas my test files....at 45 seconds is 86 MB?
    Yeah, something definitely up with that!
    Any ideas to the two thins? Getting my AppleSHIFT3 to work as well as why is ynda training files at 15 + minutes on 26 MB and my 45 second test file is 86MB?!?!
    Thanks!

  • [solved]zsh history completion not matching after first word?

    Hi!
    I just switched to zsh some days ago and I can't get the history search completion working like it's used to work with bash (history-search-backward /  history-search-forward)
    I installed grml-zsh-config, tried to rewrite most of my .bashrc to work with zsh... read a lot of man pages and changed some settings (and broke some random things... and un-broke most of them again)...
    Now when I enter p.e.:
    $ sudo tes
    ...and press the up/down arrows, it keeps the "sudo" but not the "tes" - it goes trough all commands that I called with sudo. Seems to behave the same way for other commands - keeps the first word, ignores everything else I typed.
    No idea what this is called, what it's good for or how to change it.
    Where do I look for this?
    Last edited by whoops (2012-12-01 19:09:52)

    ^ I've not used that, so I can't say whether or not my solution is better or worse. However, I suggest using "up-line-or-beginning-search"/"down-line-or-beginning-search", as described in zshall:
    up-line-or-beginning-search, down-line-or-beginning-search
    These widgets are similar to the builtin functions up-line-or-search and
    down-line-or-search: if in a multiline buffer they move up or down within the buf‐
    fer, otherwise they search for a history line matching the start of the current
    line. In this case, however, they search for a line which matches the current line
    up to the current cursor position, in the manner of history-beginning-search-back‐
    ward and -forward, rather than the first word on the line.
    From my .zshrc:
    autoload up-line-or-beginning-search
    autoload down-line-or-beginning-search
    zle -N up-line-or-beginning-search
    zle -N down-line-or-beginning-search
    bindkey "\e[A" up-line-or-beginning-search
    bindkey "\e[B" down-line-or-beginning-search

  • [SOLVED] Zsh gksu Auto Complete?

    I'm using Oh-My-Zsh configs. Really love the autocomplete in zsh compared to bash. But there's one thing I missed from bash, the autocompletion of bash can be configured with
    alias gksu='gksu '
    that will provide completion for commands after I type gksu on my terminal.
    But when I try it in zsh, it just shows me folders in in my home dir. How to make it show commands instead of dir? Thanks
    Last edited by crazyg4merz (2013-06-10 18:52:12)

    karol wrote:
    I know nothing about zsh, but
    crazyg4merz wrote:it just shows me folders in in my home dir.
    this is how plain bash works.
    Edit: It will show files and directories in current working directory, not necessarily ~.
    That one I know, but I'm not gonna change back to bash anymore. So I hope someone can help me with this. But thanks anyway, Karol

Maybe you are looking for