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

learn more… | top users | synonyms

1
vote
1answer
30 views
+50

Zsh autocomplete function with sed

I'm struggling to write an ZSH autocomplete function. My goal is to autocomplete ta's and tk's first argument with the projects listed in tmux list-sessions and tmuxinator list. Here's what I have so ...
0
votes
0answers
10 views

Using <ctrl+arrow> with zsh within (byobu-)tmux within gnome-terminal

I already added the following lines in my profile.tmux configuration file: TERM=xterm-256color set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@" unbind C-Left ...
0
votes
0answers
9 views

mac os x byobu vertical split using iTerm, tmux, zsh

How to get vertical split on Mac OS X in byobu? Ctrl + F2 is not working. It open new window instead of spliting the current. In oposite spliting horizontaly with shift + F2 works ok.
13
votes
9answers
5k views

Zsh: Open a new tab in the same directory

Say you are in /very/cool/and/deeply/nested/folder . And you want to open a new terminal tab in the same folder. How would you do that? I use Mac OS and Zsh.
0
votes
1answer
33 views

zsh (z shell) numpad/numlock doesn't work

I just upgraded to zsh/oh-my-zsh. Almost immediately I notice on my machine that the 10-digit numpad is not working. It was working in bash and fish shell. Oddly, if I hold down the fn/function key ...
0
votes
1answer
17 views

What is the ZSH equivalent of 'expr'?

The expr utility evaluates an expression and writes the result on standard output. What is the canonical ZSH way to evaluate an expression, and print the result? Solution: I believe the answer is ...
1
vote
2answers
224 views

zsh completion doesn't work under Cygwin for other drives

I'm on Win7 x64, Cygwin 1.7 and zsh (and using oh-my-zsh). Zsh newbie here. I've reviewed zsh autocompletion not working on cygwin and tried the solution there but no luck. My mount table: C: on ...
31
votes
5answers
14k views

How can I make tmux use my default shell?

On a new setup, tmux is using bash instead of my default (zsh). How can I force it to use zsh?
2
votes
3answers
749 views

Using wildcards in commands with zsh

Using commands such as rsync and scp with ZSH I've run into trouble. Instead of the (normal) behaviour of giving me all matching files, it won't run and returns: ➜ ~ rsync -azP user@server:~/* ~/ ...
3
votes
2answers
205 views

How to bind command key in zsh?

It is possible to bind Command Key from mac os x in zsh? I can't find any information about that.
2
votes
1answer
41 views

ZSH: Is it possible to get file completion to display results in a case-sensitive order?

Here's an example of what I mean: In my home dir, I have three directories starting with "work": $ ls | grep ork WorkProjects workspace workspacepython Notice that "WorkProjects" starts with a ...
0
votes
0answers
14 views

Disallowing windows to rename themselves in tmux

I've installed tmux on an OS X system with zsh provided by oh-my-zsh. I usually use quite a number of tmux windows for a whole bunch of ssh sessions, and I like to keep these windows named after the ...
0
votes
0answers
17 views

How to restore my iterm2/zsh session after restart?

I use oh-my-zsh with iTerm2 on osx and I'd like them to retain the same tabs with the same directories and hopefully the same textual history after a restart. Currently after a restart iTerm reopens ...
4
votes
3answers
786 views

Pipe to grep not working in zsh

I am doing something I always do in Bash: set | grep -i path and the output is Binary file (standard input) matches What's wrong? grep --help works, and set | more works too.
0
votes
2answers
26 views

Zsh: how to auto complete after a command?

everyone. It's a little difficult to explain what I want to do. I want to create a script 'example', which can input long commands for you after you run it with short parameters. For example, $ ...
8
votes
2answers
2k views

zsh right-justify in ps1

I'd like a multi-line zsh prompt with a right alined part, that will look something like this: 2.nate@host:/current/dir 16:00 -> I know about ...
2
votes
1answer
47 views

What's the ZSH equivalent of BASH's $PROMPT_COMMAND?

BASH supports a $PROMPT_COMMAND environment variable that defines a command to be executed before any first-level interactive prompt. I'm looking for a ZSH equilvalent of that. The documentation says ...
1
vote
1answer
18 views

Iterating over keys (or k/v pairs) in zsh associative array?

In zsh, I want to iterate over an associative array. I need both keys and values. But when I iterate over the associative array normally (for x in $assoc_array), I get only values. All examples ...
3
votes
1answer
1k views

How do I change my default shell on a remote server?

I tried changing it the way recommended in How do i change my default shell from bash to zsh?, as shown below: chsh -s $(which zsh) but that gave me an error. The system asks me to use ypchsh ...
1
vote
1answer
48 views

zsh tab completion to run scripts in current folder (.<TAB>scr<TAB>)->./script.sh

I have an issue with zsh (or oh-my-zsh): When I want to run a script in current directory, I do ./script.sh. In bash I could do .<TAB> and it would give me ./ where I could continue typing the ...
1
vote
0answers
37 views

OSX Mavericks .zshrc cannot source

I am trying to source my zshrc. It sources fine when before I add this line: . ~/Dropbox/configs/aliases Then I get this: /Users/mkrell/.zshrc:.:13: too many open files: Dropbox/configs/aliases ...
0
votes
2answers
32 views

Parse Git Branch Stopped Working (OSX)

I use a method called parse_git_branch which is called by my PROMPT. I'm using zshell, but I don't understand why this would stop working. Here's the function: parse_git_branch() { ...
0
votes
2answers
26 views

git using different version of vim than zsh

I've got a plugin called YouCompleteMe installed in vim. When vim starts with this plugin installed, it will raise a warning if the version of vim is under the minimum required. I'm using vim ...
0
votes
1answer
20 views

mdfind -onlyin not working in hidden directories recursvily? How to use it properly?

I am trying to find all files named doc.py in one of my virtualevns (called data_science), which are all in hidden directory .virtualenvs under /Users/adni and so I go: mdfind -onlyin data_science ...
2
votes
1answer
37 views

Redirect stdout/stderr of a background job from console to a log file?

I just run a job (assume foo.sh). ./foo.sh [Press Ctrl-Z to stop] bg # enter background And it generate output to stdout and stderr. Is there any method to redirect to stdout and stderr to other ...
4
votes
1answer
23 views

ZSH autolearn completition plugin

Is there something like "autolearn" command/plugin for zsh? By this I mean when I type command option option1 ... and zsh don't know about options for this particular command I want zsh to remember ...
2
votes
2answers
161 views

Key bindings in zshrc do not take any effect

I have just switched to zsh, and I would like to bind Home, End and Delete keys such that they would act similar to how they do in bash. I have found some commands that work if I enter them directly ...
31
votes
3answers
9k views

Zsh not hitting ~/.profile

I've just installed zsh on my Ubuntu system. It seems zsh isn't executing ~/.profile on init. To my best understanding, this should be an automatic behavior. What am I missing?
3
votes
3answers
51 views

Can I cycle through the history of shell commands that have only been used from current directory?

So when using arrow up/down to cycle through prior commands, is there any way I can limit those to the commands used from the current directory? This would make my life 10 times easier...
8
votes
7answers
536 views

Per-directory bash/zsh history log files

I find I do a lot of work on a project in a set directory. Sometimes — a few months down the track — I need to redo something on that project but I can't remember what I did. I use ...
0
votes
2answers
27 views

the same tr translate failed on some of machine

I use the following code and failed. $ echo $TERM xtermc $ v=/bin:/usr/bin:/usr/local/bin ; echo $v | tr ':' '\n' /binn/usr/binn/usr/local/bin It seems skip my '/'. I don't know how to solve this. ...
0
votes
1answer
12 views

Disable automatic capitalisation of git checkout BRANCH_NAME in ZSH/oh-my-zsh

I'm using zsh 5.0.2 with oh-my-zsh plugin and whenever I do tab completion on git checkout f it comes out as: git checkout Feature\ For some reason it's automatically searching uppercase branch ...
2
votes
2answers
61 views

env -i zsh | How is this magic possible?

I'm currently working, for school, on a home-made shell, therefore I'm kind of curious nowadays about how shell vars are set. Yes, this can be really exciting ! Anyway, we obviously have to deal with ...
1
vote
3answers
913 views

ALT+arrow moving between words in ZSH and iTerm 2

I logged in on one of hosting provider servers and noticed ALT + left and ALT + right moved between words in a shell prompt in a screen. What kind of key bindings I need to configure and where to get ...
6
votes
3answers
255 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 ...
1
vote
3answers
509 views

After switching back to bash can't access root

I'm new to Linux and using Debian 7. I was using bash, but tried out zsh by using chsh. Initially probably entered a bad shell name but eventually switched to zsh successfully. Now I switched back to ...
3
votes
2answers
366 views

How to search *upwards* for file? (reverse find)

I'd like to search "upwards" for a file in shell script, e.g. check $PWD, then $PWD/.., then $PWD/../.., etc. until hitting the root. Before I go and roll my own, is there some builtin bash/zsh/find ...
4
votes
1answer
113 views

Emacs key for Home & End

I'm running Emacs in urxvt with zsh as shell: ~ % echo $TERM && echo $SHELL rxvt-256color /bin/zsh ~ % My current problem is that I can't get Home key & End key working properly in ...
1
vote
1answer
16 views

Is there a syntax in ZSH for creating multiple aliases at once?

I.e., if I'd like to alias both proxychains & prch to proxychains4, is there something equivalent to this?: alias prch='proxychains'='proxychains4'
1
vote
2answers
11 views

ZSH browse content of zip file

Is there any way or plugin for zsh where I can browse content of zip files in place instead of unzipping zip file and than making zip again? I want to achieve same behavior as in Midnight Commander ...
0
votes
0answers
15 views

ZSH and Passwordless access with SSH in a shared home environment

I have a small cluster with some nodes which share their home folder through NFS. I allow passwordless SSH access to the users with this script: if [[ -e $homeDirs/$username/.ssh/id_rsa.pub ]]; then ...
3
votes
1answer
14 views

zsh warning before executing file

I frequently find myself accidentally running python files as shell scripts, e.g. $ ./test.py This has potential to cause lots of damage if there was no shebang line at the start of the file, so I ...
1
vote
2answers
27 views

In ZSH line editor, how to insert a new line?

Say I am editing a single line, with my cursor at the indicated position: $ abc ꕯ def ghi I would now like to split into two lines and continue editing (like hitting ENTER would do in a text ...
0
votes
1answer
15 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 ...
0
votes
1answer
45 views

zsh (or maybe oh-my-zsh) history gets confused with multi-line commands

if I use the up arrow in a zsh session, as you'd expect I get previous commands, from newest to oldest. Now (whether it's zsh or oh-my-zsh doing this I don't know), but if I type the start of a line ...
29
votes
6answers
8k views

zsh starts incredibly slowly

ZSH takes about a second and a half from creating a new terminal window to being ready. I'm pretty sure that the culprit is compinit. I haven't been able to find good documentation on compinit, but ...
2
votes
1answer
12 views

How to disable the confirmation of history expansions like `!!`

Zsh takes real good care of me, and at times it can get a bit too much. One of the times where I'd rather have it stay out of my business is when it "wants to make sure I want to execute the given ...
1
vote
1answer
69 views

How can I call multiple commands as arguments to a function?

I want to write a "forever" function that I can run multiple commands until I manually kill it with Ctrl-C. Basically, from the zsh command line, I know I can do this, and this works fine: $ while {} ...
1
vote
1answer
264 views

Searching through history with up and down arrow in zsh

When I first switched to ZSH when I would use the up arrow key to move through history it would filter the history based on what I had already typed so if I type mysql and then up I would be stepping ...
5
votes
2answers
367 views

bash wildcard completion

Is it possible to make bash expand wildcards on tab completion in the same style as zsh? So imagine the following: mkdir new touch new/1.txt new/2.txt new/3.log Now, ls new/*.txt<TAB> ...