Gentoo Archives: gentoo-user

From: Martin Vaeth <martin@×××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: zsh: not so bad?
Date: Mon, 13 Jul 2015 06:40:29
Message-Id: mnvmg5$8ki$1@ger.gmane.org
In Reply to: Re: [gentoo-user] zsh: not so bad? by Andrew Tselischev
1 Andrew Tselischev <andrewts@×××××××××.net> wrote:
2 > On Sun, Jul 12, 2015 at 06:52:35PM -0700, walt wrote:
3 [...]
4 >> http://wiki.redbrick.dcu.ie/mw/Account_Customisation_(zsh)
5
6 Note that this does not activate all features e.g. concerning
7 completion: You can have files displayed in your custom "ls"
8 colors in the "selection" list, you can have explanations about
9 the argument you are about to complete, you can have explanations
10 about the completing options being displayed in the list, etc.
11
12 I once more advertise zshrc-mv ...
13
14 Note that this sets the prompt only if you also install "set_prompt".
15
16 Also zsh-syntax-highlighting and auto-fu-zsh are supported
17 by zshrc-mv only if the packages are installed, of course:
18 I really like these features: One displays you commands, options,
19 strings, files, etc in different colors while typing, the other
20 "auto-completes" names for you while typing.
21 (Note that for combining both, you must install the development
22 versioen of auto-fu-zsh, since its author apparently does not
23 want to release non-git versions anymore.)
24
25 >> I made the change to PS1 permanent
26
27 set_prompt from the mv overlay can produce a prompt
28 for bash as well as for zsh.
29
30 In general, the zsh features for PS1 are also more powerful
31 than those of bash, e.g. it can automatically cut too long
32 texts. (Although set_prompt does not make use of these features,
33 becaues currently zsh does not autoamtically change colors in this
34 case which I wanted to have.)
35
36 However, be aware that some PS1 suggestions in the wild
37 (e.g. from the earlier mentioned oh-my-zsh) can turn out to be
38 a security risk. For instance, many custom prompts display
39 information about the git repository (if you are in some)
40 in an insecure way: I would noot rely that git cannot be
41 subject to some buffer overflow if e.g. you enter as root
42 a directory where some malicious user prepared a handcrafted .git ...
43
44 > zsh can also auto-complete all sorts of things, including process list
45 > for `kill' and `pkill', zfs datasets for the zfs and zpool commands...
46 > you can even write your own completions for any command.
47
48 Both is, in principle, also supported by bash, but usually the
49 zsh completion is better. Moreover, in contrast to bash completion,
50 it is easily customizable. For instance in the above mentioned
51 completion list for processes, you can have different colors
52 in the display for process numbers, tty, time, and name...
53 You can also select to have certain types being completed differently.
54 This is important if e.g. you prefer that "restricting" commands
55 like e.g. "mplayer ..." should not only provide the "typical" extensions
56 which mplayer is capable to display but really all files...
57
58 I write all this, because most of these things you do not know, still,
59 when you read the zsh manpage...