- [Show pagesource]
- [Old revisions]
- [Move]
#zsh / wiki FAQ
This page aims to link to pages in the wiki (and, if applicable, elsewhere), to answer questions that new users are likely to run into.
However, this page does not replace the official zsh FAQ. It should be checked for answers as well.
- So, where can I find answers myself?
- The zsh FAQ (READ IT! I mean it. Really.)
- My configuration is acting weird. What can I do?
- Try starting zsh with the '-f' option, and try to reproduce the problem. If that fixes your problem, the root of your problem is in your config.
- Trouble with your key bindings (eg: PgUP/DOWN, HOME/END do not work)?
- zsh's completion does not recognize new commands. What gives?
- Here is a solution for that issue: Automatic rehash on command completion.
- I got a variable:
myvar="ls -la"Executing it does not work (zsh says: command not found: ls -la), but this works in bash/ksh/whatever. What's up?- See Parameter Expansion for details.
- Why does my prompt look like
\u@\h:\w\$? …bash handles that.- Right. However, this is zshwiki.org.

- The bash convert's page links to a script that is supposed to translate prompts you might have had in bash.
- If your prompt was especially twisted, and the script fails, you will still have to read the
PROMPT EXPANSIONsection in the manual (zshmisc(1)).
- So, any way to use colors in my prompt?
- Sure: prompt setup.
- WTF is that completion thing doing? I'm pressing
TABand the cursor jumps somewhere weird…- This is not a problem with the completion system.
- Almost certainly, your prompt definition is broken.
- Read prompt setup again.
- zsh keeps terminating my background processes on exit. What can I do?
- I want character ranges like
{a..z}in bash. Help!1!!- Can a bash convert please update their convert's page, please!?

- It's simple: use
{a-z}and make sure, you've got theBRACE_CCLoption. - Why not {a..z}? Well, let pws answer: zu#11976
- Hey, my uparrow acts strangly all of a sudden. What's up with that?
- Short answer for many people:
bindkey -e. - Some distibutions (most prominently debian and derivates, that use debian's zsh package) are shipping a global zshrc file, that binds the up and down keys to vi-* widgets to make vi mode even more vi-like.
- To get back the default emacs-like behaviour in vi modes, do:
bindkey -M viins "${terminfo[kcuu1]}" up-line-or-history; bindkey -M viins "${terminfo[kcud1]}" down-line-or-history - You can be in vi-mode without setting it up by yourself. So, to understand what zsh picks as the default keymap: zshzle(1)/KEYMAPS.
- If that's still not your solution, see question 3 above.
- Okay, I want to add a function file to my setup… OR: There is this shell function in zsh I want to overwrite for some reason. Any way to do that?
- See Function Files.
- Now, zsh's vi like bindings are kind of nice. However, I keep forgetting in what mode I am in. Any way zsh can help me there?
- First, make sure you got zsh version 4.3.1 or newer.
- Then, look at: Show mode with vi keys.
- Completion suddenly stopped to work - with really weird errors… Would you please help me?
- Well, this is not exact science, since that's not a very exact question.
- If you get an error like
command not found: _foo_bar, that's a hit at this question being the right one for you. - Especially if you're experiencing such errors after an upgrade.
- Zsh (usually) caches completion system information, to avoid parsing lots of files in $fpath during every start of zsh.
- Remove that file to force reparsing of completion files from $fpath, that file is called
.zcompdump, so: % rm ${ZDOTDIR:-${HOME}}/.zcompdump- If that doesn't help, come back and ask.
- You know what, I want to write my own completion functions (compsys). How would I be going about that?
- A longer answer including a very high-level introduction into compsys. But in case you can't be bothered with a few lines of text, here is some further reading:
- Really, really consider buying "The Book", it has the gentlest introduction into the subject I know…
- And most importantly: Read existing completion code, like this one for example.
- People tell me I should use
"$@"for handling arguments until I understand why. I'm impacient, though. So why!?
docs/wikifaq.txt · Last modified: 2012/02/29 14:50 by ft



