Zsh wants to autocorrect a command, with an _ before it

This is command autocorrection, activated by the correct option. It has nothing to do with completion. You’re seeing _ruby because zsh thinks there is no ruby command and it offers _ruby as the nearest existing match. If you’ve just installed ruby, it’s possible that zsh has memorized the list of available command earlier, and it … Read more

How to get shell to self-detect using zsh or bash

If the shell is Zsh, the variable $ZSH_VERSION is defined. Likewise for Bash and $BASH_VERSION. if [ -n “$ZSH_VERSION” ]; then # assume Zsh elif [ -n “$BASH_VERSION” ]; then # assume Bash else # assume something else fi However, these variables only tell you which shell is being used to run the above code. … Read more

How can I read documentation about built in zsh commands?

The key information for getting a more useful help utility is actually included with Zsh, it’s just a matter of finding the critical—and poorly discoverable—man page: man zshcontrib (here on the web), which describes the run-help widget: By default, run-help is an alias for the man command, so this often fails when the command word … Read more

To get a prompt which indicates Git-branch in Zsh

__git_ps1 is from git-completion.bash. In zsh you probably have to provide your own function to determine the current directories git branch. There are quite a few blog posts about a git prompt for zsh. You just need: a function to provide the branch name enable prompt (command) substitution add the function to your prompt For … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)