In some cases TMPDIR may not be set, in which case it could cause issues
for zsh modules.
This change was prompted by issue #1331.
Also when creating a missing TMPDIR, use mkdir --mode=700 instead
of creating the directory and then chmoding it afterward.
Debian based systems have `lesspipe`, without '.sh' suffix.
Since `$commands` is an associative array, we do index search and set
the input preprocessor on first match.
Only set up environment for the top-level shell, and allow it to be
inherited normally.
A top level shell is usually a login shell, but can also be a
non-interactive, non-login shell in certain cases, such as when
executing an SSH remote command.
Signed-off-by: Sorin Ionescu <sorin.ionescu@gmail.com>