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

learn more… | top users | synonyms

2
votes
2answers
857 views

zsh prompts to correct executable when running bundle exec

why does zsh ask to correct rspec to spec when running bundler? ✗ rspec --version 2.12.2 ✗ bundle exec rspec --version zsh: correct 'rspec' to 'spec' [nyae]? n 2.12.2 system: ubuntu 12.10 using ...
2
votes
1answer
510 views

zsh history up-arrow history completion not working

I am not able to get the zsh history keybindings to work the way I'd like. I'd like to be able to type sudo and then use the up arrow to scroll through all history commands with the prefix sudo. I ...
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
2answers
818 views

vim backgroundcolor in tmux - how to force zsh to use screen instead of xterm in tmux

I am having the same problem like the questioner in 256 color support for vim background in tmux. In my normal terminal with zsh, I have no background color issues in vim, but when I run it inside ...
1
vote
1answer
55 views

How to source zshrc from bash script

I have a script written in bash that sets up my zsh config and changes current user's shell to zsh if needed/possible. After default shell is changed, I want zsh to load my new profile, but when I do ...
1
vote
1answer
284 views

zsh - variable assignment isn't working

I have this line in a function I'm adapting from a bash function into zsh function: local info=( $(command df -P $fs | awk 'END{ print $2,$3,$5 }') ) Whenever I call it in the func I get this: ...
5
votes
2answers
102 views

Aliases with numerical names

I just installed Oh My ZSH on my Mac. Everything is working great, except I can't define aliases with numerical names. If I execute alias 5="cd ~/Projects/Projectname/" 5 I get the following error ...
1
vote
1answer
252 views

Remove path until slash when typing in terminal

For instance, when I type a path in terminal cd project/example/one I can press Ctrl+W and remove the entire "word" project/example/one. Sometimes it's not very useful. Are there any shortcuts for ...
0
votes
2answers
825 views

ZSH: Read command fails within bash function “read:1: -p: no coprocess”

Edit: Seems to work within bash. It appears the problem is related to zsh. If there is a better site to post this issue on let me know. I am writing a simple script that creates a series of ...
1
vote
1answer
122 views

put in bash or zsh history absolute path to files I working on

I have found that in bash i frequently use something like that: vim ./somefile1 less less ./dir1/dir2/somefile2 cp some_other_relative_path_to_file and so on After that when I trying to find a ...
1
vote
2answers
267 views

tar backup zsh script

Trying to set up a cronjob ran tar script to backup site (without .git and setup folder) every night and upload time stamped archive to Dropbox. It gives me a hard time as archive is created along ...
4
votes
1answer
307 views

Is there a way to make zsh run a command after REPORTTIME?

If a process takes greater than REPORTTIME, zsh prints the time when it finishes. Is there a way to make it run a custom command in addition to this?(I would like to use notify send to let me know the ...
2
votes
1answer
32 views

Rename selfdefined function

Having a precmd() that does quite a lot, like checking for VCS information, I want to disable it when I'm navigating on slow mounted network drives. I came up with the following with which I can say ...
1
vote
1answer
278 views

How can I get bash-like job control in zsh?

I want to configure zsh so that its job control behaves more like (I think) bash does by default. In particular: When I start a background job, it is by default owned by the shell and can be ...
2
votes
1answer
46 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
1answer
119 views

Zsh alternative to bash's quick assignment and inheritance trick

There's a trick available in bash allowing you to set environment variable for child process and run it in single line, retaining original values of variable in the shell. For example, in order to set ...
2
votes
0answers
53 views

zsh autocomplete menu press enter once

I'm looking for a zsh option that allows me to only press enter once when the autocompletionmenu in open. The it works now I have to press enter to select an item in the menu and make it go away and ...
1
vote
1answer
92 views

How to remove unwanted characters when running command in terminal

I'm using zsh with oh-my-zsh as default shell. When I run a command in guake / gnome-terminal / konsole, a string with format (special-char|command-name|%) appears as the first line of output in ...
1
vote
1answer
405 views

In tmux, arrow and ctrl+arrow both result in the same code

Ubuntu 12.10, TERM is set to screen-256color in putty and tmux.conf, confirmed when I export both in and out of a tmux session. If I run cat > /dev/null and then press <down> then ...
1
vote
1answer
440 views

How can I list directories first in the terminal with zsh / ls command in Mac OSX?

Most of the similar questions / answers here don't work in Mac/OSX because there is not such a thing as --options. I am using the ZSH shell, I've been trying commands said here: ...
3
votes
2answers
121 views

Do aliases slow down a shell's start?

Sometimes my shell (zsh) takes longer to start than usual (I open the terminal, and it hangs a bit until I can input commands). I have a few aliases on my .zshrc (well, actually they're in a ...
0
votes
1answer
434 views

Weird distance between margin and cursor (iTerm2 + tmux)

I'm running iTerm 2 on 10.8 and I've installed zsh with oh-my-zsh and tmux (both from homebrew). When running zsh in iTerm it's all good, however, as soon as I run tmux, there is this weird distance ...
0
votes
1answer
260 views

Zsh keybind to CTRL+equals

I would like to bind a zsh function to the key combo Ctrl+=. I haven't found any working way to do this. If it is possible, I would like to know how.
4
votes
3answers
117 views

Transparent usage of temporary files as means of piping

As many of us are surely aware, it's always a good idea to make your program accept stdin input. Very many programs do allow that *nix environments. This lets us do cool things like piping echo "foo" ...
0
votes
1answer
417 views

How do I set the Android bash path in ZSH?

Looking through the Cordova Android docs, I see this line You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use ...
3
votes
2answers
485 views

utf-8 characters in emacs (only in term/ansi-term/multi-term) do not appear

I cannot for the life of me get utf-8 characters to appear correctly in emacs term mode on osx. They either appear as empty spaces or "<00e3><0081><00af>". I can view them in text buffers ...
3
votes
1answer
279 views

How to make 'zsh' to stop autocorrect for some words?

I'm using zsh + oh-my-zsh. How can I make zsh to stop auto-correct for some words? e.g. When I do make install or sudo apt-get install, it always tries to auto correct install to INSTALL. Can I ...
0
votes
2answers
376 views

Mercurial: how to show branches in autocompletion

It is possible to update to a specific tag or branch with the hg update <branch-or-tag> command. However, the built-in completion only shows me tags (not branches). So when i type hg update and ...
1
vote
2answers
274 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 ...
1
vote
2answers
369 views

Converting bash to zsh: declare function and if statement

I have copied this code from somewhere and am trying to modify it for my needs. It was designed for bash but I am running it under zsh. I always have trouble running bash scripts under zsh, as there ...
7
votes
1answer
5k views

How can I configure the color of 'ls' directory under zsh

I am using 'zsh'. In some directory, when I do 'ls --color=tty'. I see some directories have 'blue text' with 'green background', which makes them hard to read. Can you please tell me how to ...
0
votes
1answer
252 views

How to call history/fc from a ZSH script

I am attempting to write a script for GeekTool that will show my last X (20) commands on my screen. I can either display a file or use the output of a shell command (preferred). The problem is that ...
0
votes
2answers
86 views

I can't find where I set the zsh PROMPT

I've got zsh 5.0 installed via brew on OS X Mountain Lion. I used something to set up this lovely value for PROMPT: ...
0
votes
1answer
248 views

Sourcing bash_prompt (bash script) when running zsh (oh-my-zsh)

I have a theme that is written in bash (I think). However, I have decided to use zsh for my shell. More specifically, I'm using oh-my-zsh (a customised zsh I believe). The theme I want to use is ...
5
votes
1answer
214 views

Why are some (often long) commands garbled in bash & zsh?

Many times when I enter a long command in bash or zsh (these are the only two shells I am positive I have seen this in) the cursor warps to somewhere in the middle of the string I am entering, can ...
3
votes
1answer
415 views

Script-specific autocomplete in shell

I create a lot of little scripts to help me in my every day life. I would like to provide auto-complete for them, specially that I intend to share them with people. Now, I know I can create ...
4
votes
2answers
964 views

Emacs keybindings in zsh not working (Ctrl-A, Ctrl-E)

My Emacs keybindings in zsh are not working (CtrlA, CtrlE). I use zsh on OS X. They might be bound to some other thing. I'm currently using oh-my-zsh. And my .zshrc is over here.
3
votes
1answer
81 views

In zsh how can I run a script which is written for bash

I have switched to zsh, how can I run a script which is written for bash? I don't want to modify the script to put #!/bin/bash in the beginning for the script since it is version controlled. Is ...
3
votes
2answers
232 views

How to move files down a directory?

I have inherited a folder structure on a project and would like to simplify it a bit. I have a root full of folders (1st level) and each of those folders has a number of folders in it (2nd level) and ...
1
vote
3answers
861 views

zsh: automatically set environment variables for a directory

Let's say I have a project in: ~/working_dir Whenever I run commands from this directory, I need to have certain environment variables set. So I can export them like so: export VAR=value ...
3
votes
2answers
298 views

Unix environment variables with arguments

I'm trying to set my $EDITOR variable to be emacs with no window, so the command to call it would be emacs -nw. However if I set it like this: export ...
0
votes
1answer
649 views

Share history in multiple zsh shell

I am trying to setup zsh so that it shares command history between different zsh sessions: in multiple tabs in multiple gnome-terminals in different screen sessions I have put this in .zshrc #To ...
0
votes
1answer
274 views

Zsh customized prompt and updating variable's value

I would like to use the value of a variable set in my zsh shell to display in my prompt line. For example, let's say export TOKEN='hello' is set in my session. At that time, I load my prompt which ...
1
vote
1answer
160 views

Configuring zsh in OSX to auto start processes

I've recently converted to using zsh instead of bash in OSX and was wondering if it is possible to do the following: When I launch my terminal I would like to start various tabs and have each tab run ...
4
votes
2answers
109 views

Escape not idempotent in zsh's vi emulation?

I have zsh configured to use vi keybindings. I've noticed some unexpected behavior with "escape". In vim (I haven't tested vanilla vi) if I hit escape twice, I can hit 'i' once to return to insert ...
1
vote
1answer
668 views

What sequence does PuTTY send for ALT + DEL

When I connect to my Debian Wheezy Beta 4 server with PuTTY 0.62 on Windows 7 I'm experiencing a problem. My login shell is Zsh and it is configured to handle ALT + DEL for the action delete-word ...
2
votes
2answers
150 views

My zsh autocompletion for CDPATH stopped working

I am using zsh and I always were able to cd right into paths that are part of my CDPATH configuration but, starting a few days ago, the completion stopped working. mbp:~ $ echo $CDPATH ...
1
vote
1answer
179 views

Is there a way to reverse-search zsh history with more than one search term?

I'd like to be able to reverse-search (CTRL+R) on zsh, but have the commands searched using more than one search term. For example, I'd like to search through commands that included both "scp" and ...
0
votes
1answer
143 views

Repeated command in output for Zsh prompt

In the output of any command I put into the prompt, that command is repeated (sometimes partially). What extremely simple configuration for Zsh do I need to enter to remove this repeat? Example: ...
1
vote
1answer
124 views

cd to last directory in oh-my-zsh

Is there anyway to get oh-my-zsh and Terminal to load up my last used directory? For example I cd into ~/Desktop then close my terminal. I'd like it to open back up into the ~/Desktop folder.