[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[44f085a] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[c6b192c] | 7 | <!ENTITY zsh-download-http "https://www.zsh.org/pub/zsh-&zsh-version;.tar.xz">
|
---|
[8070ffce] | 8 | <!ENTITY zsh-download-ftp " ">
|
---|
[06333e6] | 9 | <!ENTITY zsh-md5sum "182e37ca3fe3fa6a44f69ad462c5c30e">
|
---|
| 10 | <!ENTITY zsh-size "3.2 MB">
|
---|
| 11 | <!ENTITY zsh-buildsize "48 MB (includes documentation and tests)">
|
---|
| 12 | <!ENTITY zsh-time "1.6 SBU (Using parallelism=4; includes documentation and tests)">
|
---|
[44f085a] | 13 | ]>
|
---|
| 14 |
|
---|
[f17b2db] | 15 | <sect1 id="zsh" xreflabel="zsh-&zsh-version;">
|
---|
[a6a160b] | 16 | <?dbhtml filename="zsh.html"?>
|
---|
[f45b1953] | 17 |
|
---|
[a6a160b] | 18 |
|
---|
[f17b2db] | 19 | <title>zsh-&zsh-version;</title>
|
---|
[a6a160b] | 20 |
|
---|
| 21 | <indexterm zone="zsh">
|
---|
[f17b2db] | 22 | <primary sortas="a-zsh">zsh</primary>
|
---|
[a6a160b] | 23 | </indexterm>
|
---|
| 24 |
|
---|
| 25 | <sect2 role="package">
|
---|
[f17b2db] | 26 | <title>Introduction to zsh</title>
|
---|
[a6a160b] | 27 |
|
---|
[f716ef4] | 28 | <para>
|
---|
| 29 | The <application>zsh</application> package contains a command
|
---|
| 30 | interpreter (shell) usable as an interactive login shell and as
|
---|
| 31 | a shell script command processor. Of the standard shells,
|
---|
| 32 | <application>zsh</application> most closely resembles
|
---|
| 33 | <application>ksh</application> but includes many enhancements.
|
---|
| 34 | </para>
|
---|
[a6a160b] | 35 |
|
---|
[868811b] | 36 | &lfs121_checked;
|
---|
[6eff6e1] | 37 |
|
---|
[a6a160b] | 38 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 39 | <itemizedlist spacing="compact">
|
---|
| 40 | <listitem>
|
---|
[f716ef4] | 41 | <para>
|
---|
| 42 | Download (HTTP): <ulink url="&zsh-download-http;"/>
|
---|
| 43 | </para>
|
---|
[a6a160b] | 44 | </listitem>
|
---|
| 45 | <listitem>
|
---|
[f716ef4] | 46 | <para>
|
---|
| 47 | Download (FTP): <ulink url="&zsh-download-ftp;"/>
|
---|
| 48 | </para>
|
---|
[a6a160b] | 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
[f716ef4] | 51 | <para>
|
---|
| 52 | Download MD5 sum: &zsh-md5sum;
|
---|
| 53 | </para>
|
---|
[a6a160b] | 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
[f716ef4] | 56 | <para>
|
---|
| 57 | Download size: &zsh-size;
|
---|
| 58 | </para>
|
---|
[a6a160b] | 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
[f716ef4] | 61 | <para>
|
---|
| 62 | Estimated disk space required: &zsh-buildsize;
|
---|
| 63 | </para>
|
---|
[a6a160b] | 64 | </listitem>
|
---|
| 65 | <listitem>
|
---|
[f716ef4] | 66 | <para>
|
---|
| 67 | Estimated build time: &zsh-time;
|
---|
| 68 | </para>
|
---|
[a6a160b] | 69 | </listitem>
|
---|
| 70 | </itemizedlist>
|
---|
| 71 |
|
---|
[1590eb9] | 72 | <note>
|
---|
| 73 | <para>
|
---|
| 74 | When there is a new <application>zsh</application> release, the old
|
---|
| 75 | files shown above are moved to a new server directory:
|
---|
[c6b192c] | 76 | <ulink url="https://www.zsh.org/pub/old/"/>.
|
---|
[1590eb9] | 77 | </para>
|
---|
| 78 | </note>
|
---|
| 79 |
|
---|
[f17b2db] | 80 | <bridgehead renderas="sect3">zsh Dependencies</bridgehead>
|
---|
[a6a160b] | 81 |
|
---|
| 82 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[ca17955] | 83 | <para role="optional">
|
---|
[abfacaf] | 84 | <!-- <xref linkend="pcre2"/>, The next zsh release will support it -->
|
---|
| 85 | <xref linkend="valgrind"/> and
|
---|
[d472e22c] | 86 | <ulink url='https://fbb-git.gitlab.io/yodl/'>yodl</ulink>
|
---|
[fcf4b970] | 87 | </para>
|
---|
[a6a160b] | 88 |
|
---|
| 89 | </sect2>
|
---|
| 90 |
|
---|
| 91 | <sect2 role="installation">
|
---|
[f17b2db] | 92 | <title>Installation of zsh</title>
|
---|
[a6a160b] | 93 |
|
---|
[f716ef4] | 94 | <para>
|
---|
[7299d5e] | 95 | Adapt the documentation build system for texinfo-7.0 or later:
|
---|
[f716ef4] | 96 | </para>
|
---|
[98078a63] | 97 |
|
---|
[7299d5e] | 98 | <screen><userinput>sed -e 's/set_from_init_file/texinfo_&/' \
|
---|
| 99 | -i Doc/Makefile.in</userinput></screen>
|
---|
[6eff6e1] | 100 |
|
---|
[ea36f0f] | 101 | <!-- https://github.com/zsh-users/zsh/commit/4c89849c9817
|
---|
| 102 | https://github.com/zsh-users/zsh/commit/ab4d62eb975a -->
|
---|
| 103 | <para>
|
---|
| 104 | Some programs shipped in the building system for detecting system
|
---|
| 105 | features use pre-C99 syntax rejected by GCC-14.1 or later. Fix them
|
---|
| 106 | up or Zsh would be wrongly configured and fail to build:
|
---|
| 107 | </para>
|
---|
| 108 |
|
---|
| 109 | <screen><userinput>sed -i -e 's/^main/int &/' -e 's/exit(/return(/' aczsh.m4 configure.ac &&
|
---|
| 110 | sed -i 's/test = /&(char**)/' configure.ac &&
|
---|
| 111 | autoconf</userinput></screen>
|
---|
| 112 |
|
---|
[d472e22c] | 113 | <para>
|
---|
| 114 | The documentation files contain references to zsh configuration
|
---|
| 115 | files in <filename class='directory'>/etc</filename>, but we'll
|
---|
| 116 | use <filename class='directory'>/etc/zsh</filename> to hold these
|
---|
| 117 | configuration files instead. The building system will fix up those
|
---|
| 118 | references if the <application>yodl</application> package is
|
---|
| 119 | available, but it's out of the scope of BLFS. So we need to fix up
|
---|
| 120 | the references manually:
|
---|
| 121 | </para>
|
---|
| 122 |
|
---|
| 123 | <screen><userinput>sed 's|/etc/z|/etc/zsh/z|g' -i Doc/*.*</userinput></screen>
|
---|
| 124 |
|
---|
[8f1fc267] | 125 | <!-- <note>
|
---|
[37b6e78] | 126 | <para>
|
---|
| 127 | Using a script to build with "su -c script" may produce a funny
|
---|
| 128 | configure error message: "no controlling tty". If this happens, add
|
---|
[8f1fc267] | 129 | the switch -\-with-tcsetpgrp to configure.
|
---|
[37b6e78] | 130 | </para>
|
---|
| 131 | </note>
|
---|
[8f1fc267] | 132 | -->
|
---|
[f716ef4] | 133 | <para>
|
---|
| 134 | Install <application>zsh</application> by running the following
|
---|
| 135 | commands:
|
---|
| 136 | </para>
|
---|
[a6a160b] | 137 |
|
---|
[4f4e7f18] | 138 | <screen><userinput>./configure --prefix=/usr \
|
---|
| 139 | --sysconfdir=/etc/zsh \
|
---|
| 140 | --enable-etcdir=/etc/zsh \
|
---|
| 141 | --enable-cap \
|
---|
[7299d5e] | 142 | --enable-gdbm &&
|
---|
| 143 | make &&
|
---|
[a6a160b] | 144 |
|
---|
[7299d5e] | 145 | makeinfo Doc/zsh.texi --html -o Doc/html &&
|
---|
| 146 | makeinfo Doc/zsh.texi --plaintext -o zsh.txt &&
|
---|
| 147 | makeinfo Doc/zsh.texi --html --no-split --no-headers -o zsh.html</userinput></screen>
|
---|
[6eff6e1] | 148 |
|
---|
[f716ef4] | 149 | <para>
|
---|
| 150 | If you have <xref linkend="texlive"/>
|
---|
| 151 | installed, you can build PDF format of the documentation by issuing
|
---|
| 152 | the following command:
|
---|
| 153 | </para>
|
---|
[f1e103a] | 154 |
|
---|
[06908bf6] | 155 | <screen remap="doc"><userinput>texi2pdf Doc/zsh.texi -o Doc/zsh.pdf</userinput></screen>
|
---|
[f1e103a] | 156 |
|
---|
[f716ef4] | 157 | <para>
|
---|
| 158 | To test the results, issue: <command>make check</command>.
|
---|
| 159 | </para>
|
---|
[5ef8b741] | 160 |
|
---|
[f716ef4] | 161 | <para>
|
---|
| 162 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 163 | </para>
|
---|
[a6a160b] | 164 |
|
---|
[7299d5e] | 165 | <screen role="root"><userinput>make install &&
|
---|
| 166 | make infodir=/usr/share/info install.info &&
|
---|
| 167 | make htmldir=/usr/share/doc/zsh-&zsh-version;/html install.html &&
|
---|
| 168 | install -v -m644 zsh.{html,txt} Etc/FAQ /usr/share/doc/zsh-&zsh-version;</userinput></screen>
|
---|
[6eff6e1] | 169 |
|
---|
[f716ef4] | 170 | <para>
|
---|
| 171 | If you built the PDF format of the documentation, install
|
---|
| 172 | it by issuing the following command as the
|
---|
| 173 | <systemitem class="username">root</systemitem> user:
|
---|
| 174 | </para>
|
---|
[6eff6e1] | 175 |
|
---|
[06908bf6] | 176 | <screen role="root"
|
---|
| 177 | remap="doc"><userinput>install -v -m644 Doc/zsh.pdf /usr/share/doc/zsh-&zsh-version;</userinput></screen>
|
---|
[6eff6e1] | 178 |
|
---|
| 179 | </sect2>
|
---|
| 180 |
|
---|
| 181 | <sect2 role="commands">
|
---|
| 182 | <title>Command Explanations</title>
|
---|
[29f80ebc] | 183 |
|
---|
[f716ef4] | 184 | <para>
|
---|
| 185 | <parameter>--sysconfdir=/etc/zsh</parameter> and
|
---|
| 186 | <parameter>--enable-etcdir=/etc/zsh</parameter>: These parameters are
|
---|
| 187 | used so that all the <application>zsh</application> configuration files
|
---|
| 188 | are consolidated into the <filename class='directory'>/etc/zsh</filename>
|
---|
| 189 | directory. Omit these parameters if you wish to retain historical
|
---|
| 190 | compatibility by having all the files located in the
|
---|
| 191 | <filename class='directory'>/etc</filename> directory.
|
---|
| 192 | </para>
|
---|
[fd7e0ed6] | 193 |
|
---|
[f716ef4] | 194 | <para>
|
---|
[4f4e7f18] | 195 | <parameter>--enable-cap</parameter>: This option enables
|
---|
[f716ef4] | 196 | POSIX capabilities.
|
---|
| 197 | </para>
|
---|
[fcf4b970] | 198 |
|
---|
[f716ef4] | 199 | <para>
|
---|
[4f4e7f18] | 200 | <parameter>--enable-gdbm</parameter>: This option enables the
|
---|
[f716ef4] | 201 | use of the <application>GDBM</application> library.
|
---|
| 202 | </para>
|
---|
[abfacaf] | 203 | <!-- the next zsh release will support it
|
---|
[f716ef4] | 204 | <para>
|
---|
[abfacaf] | 205 | <option>- -enable-pcre</option>: This option allows zsh to use
|
---|
| 206 | the <application>PCRE2</application> regular expression library in shell
|
---|
[f716ef4] | 207 | builtins.
|
---|
| 208 | </para>
|
---|
[abfacaf] | 209 | -->
|
---|
[a6a160b] | 210 | </sect2>
|
---|
| 211 |
|
---|
| 212 | <sect2 role="configuration">
|
---|
[f17b2db] | 213 | <title>Configuring zsh</title>
|
---|
[a6a160b] | 214 |
|
---|
| 215 | <sect3 id="zsh-config">
|
---|
| 216 | <title>Config Files</title>
|
---|
| 217 |
|
---|
[f716ef4] | 218 | <para>
|
---|
| 219 | There are a whole host of configuration files for
|
---|
| 220 | <application>zsh</application> including
|
---|
| 221 | <filename>/etc/zsh/zshenv</filename>,
|
---|
| 222 | <filename>/etc/zsh/zprofile</filename>,
|
---|
| 223 | <filename>/etc/zsh/zshrc</filename>,
|
---|
| 224 | <filename>/etc/zsh/zlogin</filename> and
|
---|
| 225 | <filename>/etc/zsh/zlogout</filename>.
|
---|
| 226 | You can find more information on these in the
|
---|
[fedbe2f] | 227 | <ulink role='man' url='&man;zsh.1'>zsh(1)</ulink> and related
|
---|
| 228 | manual pages.
|
---|
[f716ef4] | 229 | </para>
|
---|
[a6a160b] | 230 |
|
---|
[37b6e78] | 231 | <para>
|
---|
| 232 | The first time zsh is executed, you will be prompted by messages asking
|
---|
[8763a1da] | 233 | several questions. The answers will be used to create a
|
---|
[37b6e78] | 234 | <filename>~/.zshrc</filename> file. If you wish to run these questions
|
---|
| 235 | again, run <command>zsh
|
---|
| 236 | /usr/share/zsh/&zsh-version;/functions/zsh-newuser-install -f</command>.
|
---|
| 237 | </para>
|
---|
| 238 |
|
---|
| 239 | <para>
|
---|
| 240 | There are several built-in advanced prompts. In the
|
---|
| 241 | <command>zsh</command> shell, start advanced prompt support with
|
---|
| 242 | <command>autoload -U promptinit</command>, then
|
---|
| 243 | <command>promptinit</command>. Available prompt names are listed with
|
---|
| 244 | <command>prompt -l</command>. Select a particular one with
|
---|
[f716ef4] | 245 | <command>prompt <literal><prompt-name></literal></command>.
|
---|
| 246 | Display all available
|
---|
[37b6e78] | 247 | prompts with <command>prompt -p</command>. Except for the list and
|
---|
| 248 | display commands above, you can insert the other ones in
|
---|
| 249 | <filename>~/.zshrc</filename> to be automatically executed at
|
---|
| 250 | shell start, with the prompt you chose.
|
---|
| 251 | </para>
|
---|
| 252 |
|
---|
[a6a160b] | 253 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 254 | <primary sortas="e-etc-zsh-zshenv">/etc/zsh/zshenv</primary>
|
---|
[a6a160b] | 255 | </indexterm>
|
---|
| 256 |
|
---|
| 257 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 258 | <primary sortas="e-etc-zsh-zprofile">/etc/zsh/zprofile</primary>
|
---|
[a6a160b] | 259 | </indexterm>
|
---|
| 260 |
|
---|
| 261 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 262 | <primary sortas="e-etc-zsh-zshrc">/etc/zsh/zshrc</primary>
|
---|
[a6a160b] | 263 | </indexterm>
|
---|
| 264 |
|
---|
| 265 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 266 | <primary sortas="e-etc-zsh-zlogin">/etc/zsh/zlogin</primary>
|
---|
[a6a160b] | 267 | </indexterm>
|
---|
| 268 |
|
---|
| 269 | <indexterm zone="zsh zsh-config">
|
---|
[6eff6e1] | 270 | <primary sortas="e-etc-zsh-zlogout">/etc/zsh/zlogout</primary>
|
---|
[a6a160b] | 271 | </indexterm>
|
---|
| 272 |
|
---|
| 273 | </sect3>
|
---|
| 274 |
|
---|
[5ef8b741] | 275 | <sect3>
|
---|
| 276 | <title>Configuration Information</title>
|
---|
| 277 |
|
---|
[f716ef4] | 278 | <para>
|
---|
| 279 | Update <filename>/etc/shells</filename> to include the
|
---|
| 280 | <application>zsh</application> shell program names (as the
|
---|
| 281 | <systemitem class="username">root</systemitem> user):
|
---|
| 282 | </para>
|
---|
[5ef8b741] | 283 |
|
---|
| 284 | <screen role="root"><userinput>cat >> /etc/shells << "EOF"
|
---|
[e74610e7] | 285 | <literal>/bin/zsh</literal>
|
---|
[5ef8b741] | 286 | EOF</userinput></screen>
|
---|
| 287 |
|
---|
| 288 | </sect3>
|
---|
| 289 |
|
---|
[a6a160b] | 290 | </sect2>
|
---|
| 291 |
|
---|
| 292 | <sect2 role="content">
|
---|
| 293 | <title>Contents</title>
|
---|
| 294 |
|
---|
| 295 | <segmentedlist>
|
---|
[5ef8b741] | 296 | <segtitle>Installed Programs</segtitle>
|
---|
[a6a160b] | 297 | <segtitle>Installed Libraries</segtitle>
|
---|
| 298 | <segtitle>Installed Directories</segtitle>
|
---|
| 299 |
|
---|
| 300 | <seglistitem>
|
---|
[e74610e7] | 301 | <seg>zsh and zsh-&zsh-version; (hardlinked to each other)</seg>
|
---|
[8763a1da] | 302 | <seg>Numerous plugin helper modules under
|
---|
[36e088d] | 303 | /usr/lib/zsh/&zsh-version;/</seg>
|
---|
[8763a1da] | 304 | <seg>/usr/{lib,share}/zsh and /usr/share/doc/zsh-&zsh-version;</seg>
|
---|
[a6a160b] | 305 | </seglistitem>
|
---|
| 306 | </segmentedlist>
|
---|
| 307 |
|
---|
| 308 | <variablelist>
|
---|
| 309 | <bridgehead renderas="sect3">Short Description</bridgehead>
|
---|
| 310 | <?dbfo list-presentation="list"?>
|
---|
| 311 | <?dbhtml list-presentation="table"?>
|
---|
| 312 |
|
---|
| 313 | <varlistentry id="zsh-prog">
|
---|
| 314 | <term><command>zsh</command></term>
|
---|
| 315 | <listitem>
|
---|
[f716ef4] | 316 | <para>
|
---|
| 317 | is a shell which has command-line editing, built-in spelling
|
---|
| 318 | correction, programmable command completion, shell functions (with
|
---|
[4c24eb0a] | 319 | autoloading), a history mechanism, and a host of other features
|
---|
[f716ef4] | 320 | </para>
|
---|
[a6a160b] | 321 | <indexterm zone="zsh zsh-prog">
|
---|
| 322 | <primary sortas="b-zsh">zsh</primary>
|
---|
| 323 | </indexterm>
|
---|
| 324 | </listitem>
|
---|
| 325 | </varlistentry>
|
---|
[1aa3a3ca] | 326 |
|
---|
[a6a160b] | 327 | </variablelist>
|
---|
| 328 |
|
---|
| 329 | </sect2>
|
---|
| 330 |
|
---|
| 331 | </sect1>
|
---|