Zsh is a shell designed for interactive use, although it is also a powerful scripting language.

learn more… | top users | synonyms

3
votes
1answer
52 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
0
votes
1answer
17 views

automatically launch/open a file when it changes

OS: OS X Lion Shell: zsh I'd like to automatically launch/open a file when it changes. Background: i'm working on a windows vm, generating pdfs. Syncing via dropbox and when a file changes on ...
0
votes
0answers
63 views

Why commands work at top of file, but not at the end

This is .tmux.conf file & as you can see it has a shell selection command at top. But it doesn't work if I put this line at the bottom. when I open tmux, it doesn't show any error or anything, but ...
0
votes
1answer
137 views

Tracing an error message when starting Tmux or Vim

Recently when I start Tmux on my Mac (with Powerline) in iTerm, I get an error git: Permission denied. I also get the error over and over again as I type in Vim (also using Powerline). As you can ...
2
votes
1answer
400 views

ZSH: how to ZLE widgets directly?

The documentation says in section 18.4 Widgets, that a "widget’s job is simply to perform some small action". But I cannot find a general description how to invoke these actions, i.e. how to call a ...
1
vote
0answers
90 views

Unintended autocomplete or alias in Terminal

There is a "strange" autocomplete function in my macbook. If I try to type "ps -aux" in terminal (iTerm or TotalTerminal) with the hit of "s" in ps, automatically this happens: "ps -p $$ # Tells the ...
3
votes
1answer
121 views

Can I use the output from a ZSH custom function in Tmux's status bar?

I defined a function in ~/.zshrc: foo() { print "FOO" } I'd like to output it in my Tmux status bar. I added this to ~/.tmux.conf: set -g status-right "foo: #(foo)" But I only see the static ...
1
vote
1answer
466 views

Mac OSX Mavericks - ZSH can't 'source ~/.zshrc', too many open files

I can't source any changes to my .zshrc (or my .bash_profile for that matter), because I get this error when I try: /Users/ME/.zshrc:source:100: too many open files: /Users/ME/.zshrc I've tried ...
1
vote
1answer
178 views

How do I tell if zsh is running with privileges?

In my .zshrc, I have commands that launch instances of various program, like Mozilla Firefox and Evolution. I obviously do not want to launch them as root so I want to check whether I am root before I ...
0
votes
2answers
33 views

How to run “time” on a function in zsh

This works: time ls -l This does not work f() { ls -l } time f No time output is printed in the second case. Why?
1
vote
1answer
135 views

Disabling “oh-my-zsh” SVN completion

I am using Zsh version: 4.3.11 with the oh-my-zsh framework. When coupled with "oh-my-zsh", Zsh will attempt to autocomplete SVN (and Git for that matter) commands when the TAB key is pressed during ...
1
vote
4answers
71 views

Remove all folders that does not contain a specific name in UNIX

I'm trying to figure out my old skill in *nix. What I'm trying to achieve is to remove every folders that does not contain a specific word. This is the listing ➜ myfolder: pwd /user/myfolder ➜ ...
1
vote
1answer
86 views

When is .zprofile file read?

I am using .zprofile to set up some stuff, and I assume it is evaluated everytime I log in to given user. Am I correct?
0
votes
0answers
52 views

After Reinstall of Rails, Cannot Run `rails server`

On my main dev computer, I had had ruby installed from a ppa. I decided to reinstall it with rvm for consistency between computers. To uninstall my current environment, I ran sudo apt-get remove ...
1
vote
0answers
218 views

tmux in zsh with vi mode, toggle cursor shape between normal and insert mode

(note: I wrote this question on stackoverflow, but got flagged as offtopic, so I'm re-writing it here) Here's what I want: Consistent behavior (as much as possible) between Vim, MacVim, zsh with ...
1
vote
1answer
54 views

Pre-compiled command line input in zsh

I recently set up a ubuntu 12.04 64 bit machine. I use tmux with many open windows, all of them use zsh as shell, some of them through a chroot environment that uses the same home folder of the normal ...
2
votes
1answer
104 views

Common keyboard shortcuts for zsh zle and bash readline

I use zsh as my shell, but there are a lot of commandline programs which use readline. I also like to configure different keyboard shortcuts (e.g. ctrl backspace and ctrl delete). Is there a way to ...
3
votes
1answer
53 views

Why does `${$(pwd)}` output current working directory in zsh?

In zsh, ${$(pwd)} output the current directory. However, if I run echo ${/path/to/somewhere}, it just shows an empty line. Why does this happen? Thanks!
1
vote
1answer
316 views

Any way to get list of functions defined in zsh (like alias command for aliases)

I can type alias and get a list of defined aliases in zsh How can I get a list of function names defined in zsh? When I type "functions", my shell window hangs after displaying lots of functions, ...
0
votes
1answer
50 views

How to zsh pipe to grep to match remote branches beginning with 'orgin/'

I tried this: git branch -r --merged | grep '^origin/' But I get nothing... When I remove the caret: ✗ git branch -r --merged | grep 'origin/' origin/HEAD -> origin/master ...
2
votes
4answers
254 views

Strategy to maintain dotfiles for different OSs (i.e. osx and ubuntu)

I use a Git repository to maintain my dotfiles (vimrc, zshrc, tmux.conf, etc.). As I've two different operating systems (OSX at home and Ubuntu at work) I've dedicated a branch for each system. This ...
0
votes
1answer
73 views

Steam locomotive in zsh

In zsh, when I type ls, it lists the files in the directory, as I would expect it to. However, when I type sl zsh does not ASK whether I want a steam locomotive to roll across my screen. It simply ...
0
votes
0answers
50 views

Why the second time creating a ramdisk make /dev/rdisk2 instead of /dev/rdisk1?

I run the first time ever: diskutil erasevolume HFS+ ramdisk `hdiutil attach -nomount ram://8475854` It create the ramddisk at /dev/rdisk1. The computer power off, power on then I repeat the same ...
2
votes
2answers
5k views

Oh my zsh on windows

I have installed Cygwin on my windows 8.1 Now I want to install ZSH and Oh My ZSH in cygwin. I have installed ZSH in it by selecting Shells > Zsh in Select screen. and I found this link to ...
0
votes
1answer
184 views

How to batch rename files using bash

I know there are lots of such questions, but I couldn't find one (or a combination of several), which describes the things I want to do. I think I need to use regular expressions, but I am not very ...
0
votes
2answers
394 views

Prevent zsh from trying to expand everything

Recently switched from bash, I noticed that zsh will try to expand every command or argument that looks like it has wildcards in it. So the following lines won't work any more: git diff master{,^^} ...
2
votes
1answer
168 views

make a certain software version the default in ubuntu

I currently have 2 version of php installed on ubuntu 12.04. one for php 5.3 installed using apt-get while the other one is installed with xampp with php 5.5 When i execute these commands: > ...
1
vote
2answers
62 views

Alias for directory using a symbol

I'm looking to set up an alias for my work directory, which can change as I change context, and I was trying to find something that was short enough to stand in as a replacement for ~. I'd be tickled ...
0
votes
1answer
55 views

zshell globing works for ls, but not scp

Note: This problem is with zshell, it works with bash. I have some images: $ ls *.jpg a.jpg b.jpg But when I try to copy them with scp, it says there are none: $ scp *.jpg host: *.jpg: No such ...
1
vote
3answers
79 views

Enter a string containing “!!” on a shell without it being interpretted

I'm trying to send a string that contains "!!" in it. However, every time I execute it on zsh, zsh replaces !! with the last command entered. How can I get zsh to not interpret "!!"? I have also ...
1
vote
1answer
212 views

Run a local command after closing an SSH connection?

I've set up my zsh to update the XTerm title whenever I change directories. It's neat! Unfortunately I have one common problem, which is this: % cd foo; # title changes to "host1:~/foo" % ssh ...
1
vote
1answer
157 views

Zsh crashes on specific tab completion (workon)

This is an annoying bug related to ZSH and python virtualenvwrapper. I couldn't find any clue on this anywhere on the web, so I am going to make a new post in SU! Symptoms Use ZSH, and python ...
2
votes
1answer
190 views

Exclude directories in ZSH glob

With zsh, you can use **/* as a short alternative to using find. Is there any way to restrict that to regular files, that is an equivalent to the -type f option?
0
votes
1answer
30 views

why is the terminal or “ZSH” protesting on this command

to be clear, if I run this without the alias everything is ok but with the alias in my "zshrc" config alias hh="history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r" ...
0
votes
0answers
74 views

is there a way to print out time with REPORTTIME even if the command had error?

I really like REPORTTIME feature in zsh, but according to the zsh doc, it will only output when command result is nonzero. But there are some cases when some command takes a while and fails, and I ...
1
vote
0answers
25 views

crontab does not lauch [duplicate]

I am trying to launch a cron job every hour (an interactive system upgrade). The code that does the actual update ( a no-password sudo yum update) is in my .zshrc (I use zsh as my shell). To launch ...
6
votes
3answers
662 views

Removing the useless space at the end of the right prompt of zsh ($RPROMPT)

In zsh, there is always a space character at the right of my right prompt. I tried with a very simple .zshrc such as: PROMPT="#" RPROMPT="*" There is a always a space after the * on the right of ...
2
votes
1answer
81 views

What's the rule on using the word “git” as an alias?

I used to keep my git aliases in a file outside of my .gitconfig file, in the normal format of: alias gb="git branch --verbose" which worked great. But, after looking around at others' dotfiles, I ...
1
vote
1answer
44 views

zsh — ^W behavior with oh-my-zsh

I've recently started using ZHS with oh-my-zsh script pack. It does excellent job except of weird ^W shortcut behavior. For example if I have following command line and symbol ▮ denotes cursor ...
1
vote
1answer
323 views

How do I fix the serious lag with rake autocomplete in oh-my-zsh

I'm getting serious lag when doing auto complete for rake. I have a 2011 MBP with an SSD and I'm still getting something like 3 - 5 second lag when attempting to autocomplete. Thanks for your help! ...
4
votes
1answer
294 views

Zsh says “no matches found” when trying to download video with youtube-dl

I downloaded youtube-dl using pip on CrunchBang (a Debian Wheezy distro). When I run youtube-dl {video URL} I get zsh: no matches found: {video URL} I guess it has something to do with zsh, ...
1
vote
1answer
50 views

How can I complete directory entries that are under a subdirectory?

I have an function in my .zshrc called c that is defined like so c() { cd ~/Code/$1 } How can I teach ZSH to treat this c function just like I had done cd ~/Code from the command line so that it ...
1
vote
1answer
329 views

Split window programmatically with iTerm?

on my development workstation I often have to start the same commands every morning. zeus start, zeus server (booting rails via zeus), redis-server, and like 3 others. I know a lot of people would ...
0
votes
1answer
327 views

zsh initial working directory

When I start a new zsh session it always seems to set its working directory to the last-known working directory of any other zsh session running on my system. Is there a way to configure zsh to just ...
0
votes
1answer
41 views

Time command not behaving correctly

I am having a weird problem with the time command. When I try and run $ time rspec spec It should return Finished in 15.78 seconds 75 examples real 0m22.334s user 0m17.952s sys 0m2.643s ...
2
votes
1answer
690 views

Why is a percent sign appearing before each prompt on zsh in Windows?

I'm getting zsh set up in Windows and I'm getting a reverse (black on white (black terminal background)) percent symbol in the first character position in the line just above every prompt. Usually ...
3
votes
1answer
100 views

Setting the $SHELL environment variable

For some reason, when I run chsh -s /bin/zsh, my $SHELL environment variable isn't getting set. When I run: echo $SHELL It outputs: /bin/bash
3
votes
2answers
127 views

Is it possible to highlight the non-breakable space in zsh / terminal?

I’m looking for possibility to somehow highlight the non-breakable space (\xA0) in the shell output to distinguish it from the normal space during debug sessions. E. g., I would like to see the output ...
2
votes
1answer
75 views

Weird behaviour of zsh iteration over content of a variable

I have a weird behaiour with ZSH when iterating over the content of a variable. A demo is better than a long talk in this case, so here is my problem: (yoann@freya) test_bash » ls file1 file2 file3 ...
1
vote
1answer
230 views

awesome does not recognize PATH change

I use zsh as my login shell, lightdm as login manager and awesome as window manager. I changed the PATH Variable in my ~/.zshrc and it works on the terminal, but awesome itself does not recognize the ...