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

learn more… | top users | synonyms

0
votes
1answer
28 views

zsh how to backspace through quotes

How can I backspace and move through quotes in zsh? Pressing left or backspace does nothing at the start of the quote after I hit enter after typing ': $ echo ' quote> The ...
2
votes
2answers
46 views

Locating the source of a function in zsh

I have this annoying issue in my zsh shell where a function is being declared somewhere and that function is named "cp" so it's overriding the normal cp behavior. I'm trying to locate the function ...
1
vote
1answer
170 views

Why does my zsh prompt wander upwards when window is too narrow?

I have a weird behaviour that seems to be a combination of zsh and maybe urxvt (?) My setup is this: I start urxvt -e 'tmux' to get myself a terminal which launches zsh as the default shell. I then ...
0
votes
0answers
43 views

Zsh prompt produces an error

I have the default prompt for oh-my-zsh, which is great when I have a git repo, but if there is no git repo its actually failing instead of putting nothing. I trapped an ascii image to err just for ...
1
vote
1answer
40 views

Nested substitution in ZSH

I use zsh. Say, for instance, that I want to remove the current directory from cdpath. That means that I need to remove an element based on content, which fits the ${name:#to_be_removed} pattern ...
0
votes
1answer
177 views

ConEmu (with bash/zsh etc. shell) - can't use key bindings using “Meta” (Alt) key

I have key bindings created with zsh such as: bindkey -s "^[l" 'ls -lrt --color=always\n' that I want to execute in ConEmu by holding "Alt" and pressling "l". It just prints a rectangle character ...
1
vote
1answer
87 views

rxvt-unicode (urxvt) v9.19 is not reporting users that are using ttys

I have some problems with urxvt v9.19, I'm not able to see myself reported in the who command. My setup is: Archlinux: Linux arch 3.12.7-1-ARCH #1 SMP PREEMPT Fri Jan 10 08:50:35 CET 2014 x86_64 ...
1
vote
1answer
20 views

Forwarding shell to servers without installing it

is there any way how to forward a shell to a server without installing it on that box? This is what I need to do: I work for company where we admin X boxes and I will probably not be allowed to ...
0
votes
0answers
195 views

Terminator and Zsh: ctrl+D not closing session

I've been a Terminator and zsh user for a while with consistent profiles across several machines. However, on a freshly installed Linux Mint machine, for some reason Ctrl+D (EOT) isn't closing the ...
1
vote
2answers
566 views

Zsh not recognizing ls colors

I just was introduced to Zsh and so far I am really liking the customizability. I use the following line to set up colors in .zshrc: zstyle ':completion:*' list-colors '' This gives me these ...
3
votes
1answer
595 views

How do I negate a ZSH regular expression test?

How do I negate the ZSH regex operator? I'd like to do something like: if [[ $host !~ '^myhost[0-9]+$' ]] then # Do stuff # ... fi ...or: if [[ !($host =~ '^myhost[0-9]+$') ]] then # ...
0
votes
1answer
68 views

zsh function cannot be used in tmux

I wrote up a special function to wrap a command, in ZSH, so it doesn't output any warnings and runs the process in my background. This command works great without tmux, but when I try to use it in a ...
1
vote
2answers
60 views

How to delete one directory level in a command argument (up to a slash) on ZSH command line?

I just switched from bash to zsh. One thing that is different and a bit annoying from me that Alt-Backspace removes the whole argument instead of just one word. I'm used to using it to remove one ...
3
votes
1answer
54 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
76 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
148 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
444 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
93 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 ...
5
votes
1answer
134 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
524 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
212 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
36 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
160 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
72 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
101 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
62 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
243 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
60 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
115 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
54 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
428 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
55 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
290 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
75 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
52 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
193 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
428 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
207 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
62 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
87 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
235 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
171 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
220 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
32 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
86 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
728 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 ...