zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added.

learn more… | top users | synonyms

96
votes
10answers
34k views

Moving from bash to zsh

I'm considering moving from bash to zsh as I often come across posts praising zsh. I'm an experienced command line user and I'm assuming the basics are pretty much the same, so I'm looking for advice ...
12
votes
3answers
14k views

Setting up aliases in zsh

I know that in bash you can set up aliases in a .bash_aliases file so that the command you type doesnt need to be a command stored in the binaries in the system. Is there any way I can get aliases ...
11
votes
2answers
8k views

Can't make ZSH the default shell

I am trying to set ZSH as my default shell, however it keeps reverting back to bash. I have tried this code: sudo chsh -s $(which zsh) I've also tried: sudo chsh -s /bin/zsh Also tried these ...
11
votes
1answer
5k views

How do you share history between terminals in zsh?

How can it be achieved so that every command that is entered, is visible in every open terminal's history? When having multiple terminals open, the history isn't shared, i.e. what you entered in one ...
10
votes
4answers
1k views

Configuring to detect if a command does not exist, suggest installation

Can the zsh shell be configured to show what bash shows when a command does not exist, similarly to this: kahless:~$ sysv-rc-conf The program 'sysv-rc-conf' is currently not installed. You can ...
7
votes
1answer
1k views

Getting command-not-found working under zsh

I'm trying to get the command-not-found feature under Ubuntu to work under zsh, without luck: ➜ ~ pdfunite zsh: command not found: pdfunite ➜ ~ bash u@ub:~$ pdfunite The program 'pdfunite' is ...
7
votes
2answers
282 views

Pressing enter produces ^M instead of a newline

For example, if I am tail -fing a file or reading user input, <Enter> will produce ^M in the terminal instead of ending the read or adding a newline to stdout. ^J works fine. I'm sshing into ...
6
votes
3answers
3k views

Change default shell for Terminator

I want to change the default shell of Terminator to zsh. In /etc/passwd/ I've changed the default shell to /bin/zsh. This settings changes the default shell in LXTerminal (the default terminal on ...
6
votes
1answer
2k views

ZSH is not launched while opening a new terminal with `gnome-terminal`

I am using Ubuntu 12.04 and started using zsh. The way I changed my shell is $ sudo chsh -s /usr/bin/zsh I changed my prompt theme etc and the changes kicked in. When I do a echo $SHELL I can see ...
6
votes
1answer
3k views

chsh -s /usr/bin/zsh not working

I'm trying to permanently change my shell to zsh using chsh command, but it's not working. zsh is installed (via apt) and works fine when I invoke it directly from a bash prompt terminal. But I ...
6
votes
1answer
270 views

automatically run ls after changing path using autocd

So everytime I change the directory I would like the new path to automatically get listed with ls.There are solutions if the path gets changed using cd but I never found a solution that would work ...
5
votes
1answer
2k views

Command history in zsh

Currently I have zsh set up in such a way that command history is shared between all sessions immediately. Say I have a terminal emulator open with two tabs, each with a zsh session, A1 and A2. If I ...
5
votes
2answers
533 views

guake with zsh doesn't start

I changed guake to use /bin/zsh from /bin/bash. now it doesnt start. by start, i mean that when click the shortcut key, guake just pops up for a second, and then disappears. I changed the default ...
4
votes
2answers
515 views

Apt-get * wildcard with ZSH

ZSH: sudo apt-get remove --purge ubuntuone-* ERROR: zsh: no matches found: ubuntuone-* Works on Bash. What's the problem ? :-D
4
votes
1answer
2k views

Can't change theme of ZSH in Ubuntu 12.04

I have changed the theme in my ~/.zshrc file however whilst some of the colors in the prompt change the text size and background color remain as the Ubuntu default. Any one know how I can override ...
3
votes
3answers
2k views

Add directories to $PATH without repeating yourself

My shell is zsh and OS is Ubuntu 13.04 I need to add directory to $PATH to make it work in following places: In graphical environment(Unity) (such as startup applications, gmrun program that runs ...
3
votes
1answer
177 views

How can I get tab completion with juju in zsh?

I use zsh as my shell and tab completion doesn't work, how can I enable it?
3
votes
2answers
92 views

zsh doesn't open vim or gvim until terminal is closed [closed]

When I try to launch vim or gvim from the terminal (or a program tries to do it such as git rebase --interactive). It doesn't open until the terminal closes, it just sits there thinking the program ...
3
votes
1answer
1k views

Changing shell to zsh broke my terminal

I ran sudo chsh -s /bin/zsh to change my default shell to zsh. I then restarted my computer. When I turned it back on I get just $ as the prompt, so it doesn't look like I even get bash any more. ...
3
votes
3answers
2k views

How to fix strange backspace behaviour with urxvt + zsh?

I use urxvt in combination with zsh. However since my fresh install of ubuntu 10.04 I have the following problem. If I type backspace the cursor moves to the right (instead of deleting the characters ...
3
votes
1answer
1k views

Change the background color of command line in zsh when I change the prompt theme

I installed the zsh package. So, now when I type zsh in terminal it switches from back to zsh. Also, I downloaded the oh-my-zsh framework to customize zsh. When I change theme name in .zshrc file to ...
2
votes
2answers
109 views

Why usage of '*' doesn't always work on zsh?

I ran the following command on zsh sudo apt-get install rhythmbox* It produced an error, when I ran the same command in bash it worked. Why does this happen? How can I make the above command work ...
2
votes
3answers
1k views

How to find out where $MANPATH is set?

How can I find out in which configuration file the environment variable $MANPATH is set? Is there a way to backtrace the values? I am aware of that I can grep through the whole file system using find ...
2
votes
3answers
2k views

Installing the most recent version of the Z shell

The latest release version of zsh is 4.3.14. I was wondering what is the easiest way to install it on Ubuntu. Is there a PPA for it? Also, is there a site that lists or collects Ubuntu PPA's for ...
2
votes
2answers
400 views

Startup commands with zsh as default shell?

I'd like some commands to run a script at startup. However, my default shell is zsh, so the traditional .bash files seems unwise. At the same time, I believe .zshrc is sourced at every shell ...
2
votes
1answer
63 views

Less output does not show output in terminal after quitting it

Previously, if I ran something | less, and then press q, it used to return me to the prompt with the output of less still visible. $ seq 1 100 | less 1 2 3 4 :q $ <prompt here. I can still see the ...
2
votes
1answer
225 views

Update the zsh autocorrection for commands

I use zsh and it's great. But the autocorrection is not smart at all. I think it is not updated at any time. So I get the following often: dennis@ponyboy ~ % sudo aptitude search zsh zsh: correct ...
2
votes
2answers
937 views

Git Branch in ZSH Prompt?

When working on a git repository with multiple branches, how do I modify my zsh prompt to include my current active branch?
2
votes
1answer
28 views

Enable Zsh prompt username

So I just installed Zsh, and it shows for each command arrow and then ~. How do I enable my username@computername or something similar? I am reading https://wiki.archlinux.org/index.php/zsh but cannot ...
2
votes
1answer
539 views

How do I automatically load my ~/.zprofile when I log in?

I've started using zsh for my login shell. I've create an a ~/.zprofile, but in order for it to be put into effect, I have to manually source it. How can I have my settings load automatically?
2
votes
1answer
1k views

Shell Prompt Customization?

I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off. My usual shell is ...
2
votes
1answer
381 views

How do backslash escapes work with echo -E in zsh?

I have a script where I need to preserve the \\ character sequences but the command echo -E \\ prints \ when it should be \\. Correct? Is this a bug in the version of Ubuntu I am using? I am ...
2
votes
0answers
173 views

URxvt has lags in Ubuntu 13.04 [closed]

I use urxvt as my default terminal and zsh as default shell. I use this two tools everywhere, but after today upgrade from ubuntu 12.10 to Ubuntu 13.04 I got some lags in term. Lags means - when I ...
1
vote
1answer
1k views

Rerun previous command under sudo

I want to be able to run a command, it fails cause it doesn't have proper permissions. Then I can write "please" to sudo the command I just ran. Here's what I want to do in the terminal: $ run ...
1
vote
4answers
781 views

Cannot execute shell /bin/zsh when execute a shell command in vi

I use bash. But it cannot find zsh. How to change this? ps:I don't want to install zsh.
1
vote
1answer
307 views

Execute file with default program from zsh?

In windows powershell I can open a pdf in adobe reader by doing > Invoke-Item ~/path/to/my.pdf Is there a way to open files in the default gui app from zsh?
1
vote
1answer
756 views

Cannot change zsh prompt

For some reason I can't change my zsh prompt by typing, say, PS1="%#". I'm using the admin-suggested config on Ubuntu 11.10. Am I doing it wrong or is it a bug? Here's the content of my ~/.zshrc: # ...
1
vote
1answer
81 views

Can't set alias in zsh — command not found?

I'm trying to set alias conky-lua ="conky -c ./.conky/conkyrc &" so to start conky-lua. but when I source .zshrc it says command not found. A possible solution that I found on Stackoverflow is to ...
1
vote
2answers
391 views

Edit ZSH theme for virtualenv name

I use zsh theme intheloops. The theme looks like this when no virtual env. is active -- an empty line -- [sourabh@skynet] ~/Code/django_apps/cope (master) ⚡ ❯ and when an env. is active, (env ...
1
vote
1answer
918 views

When $SHELL variable does not change when I switch shell

I am using 'zsh' by default. But when I am in my zsh shell, I enter 'bash' to switch to bash, why the $SHELL variable does not change? Can I make screen to use whatever shell I right before execute ...
1
vote
1answer
233 views

find . -type l says missing argument

I want to find all symbolic links in the current directory and below. Therefore, I used: find . -type l Running that clears the screen showing "Pattern not found (press RETURN)" at the bottom of ...
1
vote
2answers
620 views

How to use a hex color code in zsh?

I have color config of my shell PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' how to use hex color ...
1
vote
1answer
46 views

Changing the background of terminal in ZSH when connected to server

I use terminator as a terminal, zsh shell and oh my zsh, on both my laptop and my server, for what it's worth, I created an alias named vps to connect to my vps using ssh. Currently terminator ...
1
vote
1answer
44 views

Reset Zsh config?

Yesterday I installed Zsh, and tried to configure some things, but somehow everything is messed up. A lot of commands do not work, I've done PROMPT in ~/.zshrc but it does not work correctly either. ...
1
vote
1answer
253 views

Error Password: chsh: PAM: Authentication failure when try to install Oh my zsh

I try to install Oh my zsh. After install zsh (sudo apt-get update && sudo apt-get install -y zsh) Then I install sudo apt-get install -y curl then install git. the problems occurs ...
1
vote
1answer
399 views

How to run zsh and tmux with xterm-256color by default

I am using ubuntu gnome 14.04 and I want to have tmux and zsh opened when I start a new terminal. For now, in my preference of the terminal, I run tmux by default. In the ~/.tmux.conf file I have ...
1
vote
1answer
285 views

npm completion broken

I'm running npm 1.2.18 and node v0.10.15. npm completion is broken. If I try to tab complete with npm or if I run npm completion, it displays: npm ERR! System Linux 3.11.0-14-generic npm ERR! ...
1
vote
1answer
447 views

zsh: command not found: svn_prompt_info

I install the oh-my-zsh through the gist https://gist.github.com/tsabat/1498393 However, whatever command I typed in the shell, the execute the command then print "zsh: command not found: ...
1
vote
2answers
138 views

When I use ZSH, how do I set PATH in /etc/profile.d?

I'm using zsh as my shell, and I'm trying to configure my environment. I usually define my $JAVA_HOME variable by creating a file: /etc/profile.d/java.sh with the following content export ...
1
vote
1answer
33 views

Upstart sub-command tab completion with zsh

I've just recently switched to ZShell, and am loving it so far. One issue I'm having however is that my init.d or upstart scripts used to have tab completion for their subcommands, but now it doesn't. ...