#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.

  1. So, where can I find answers myself?
  2. 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.
  3. Trouble with your key bindings (eg: PgUP/DOWN, HOME/END do not work)?
  4. zsh's completion does not recognize new commands. What gives?
  5. 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?
  6. 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 EXPANSION section in the manual (zshmisc(1)).
  7. So, any way to use colors in my prompt?
  8. WTF is that completion thing doing? I'm pressing TAB and 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.
  9. zsh keeps terminating my background processes on exit. What can I do?
    • See the hup and check_jobs entries in Job Control Options.
    • Use tmux or screen to run them in the first place. reptyr can also be useful.
  10. I want character ranges like {a..z} in bash. Help!!!
    • Can a bash convert please update their convert's page, please!? :-)
    • It's simple: use {a-z} and make sure, you've got the BRACE_CCL option.
    • Why not {a..z}? Well, let pws answer: zu#11976
  11. 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.
  12. 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?
  13. 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?
  14. 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.
  15. You know what, I want to write my own completion functions (compsys). How would I be going about that?
  16. People tell me I should use "$@" for handling arguments until I understand why. I'm impacient, though. So why!?
  17. My RPS1/RPROMPT is one space away from the edge, why?
    • It is intended behavior due to problem terminals(more details)
    • As of version 5.0.5: ZLE_RPROMPT_INDENT=0 # will remove the space, but may still cause problems in weird terminals.
docs/wikifaq.txt · Last modified: 2016/02/25 09:53 by spamkiller