Welcome to mirror list, hosted at ThFree Co, Russian Federation.

setup2.sgml « doc « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4b2ecf6ef851fcf3ae0b5ccc00ee5d6509c9b73a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<sect1 id="setup-env"><title>Environment Variables</title>

<para>
Before starting bash, you may set some environment variables.  A .bat
file is provided where the most important ones are set before bash in
launched.  This is the safest way to launch bash initially.  The .bat
file is installed in the root directory that you specified during setup
and pointed to in the Start Menu under the "Cygwin" option.  You can
edit it this file your liking.</para>

<para>
The <envar>CYGWIN</envar> variable is used to configure many global
settings for the Cygwin runtime system.  Initially you can leave
<envar>CYGWIN</envar> unset or set it to <literal>tty</literal> (e.g.
to support job control with ^Z etc...) using a syntax like this in the
DOS shell, before launching bash.  </para>

<screen>
<prompt>C:\&gt;</prompt> <userinput>set CYGWIN=tty notitle glob</userinput>
</screen>

<para>
The <envar>PATH</envar> environment variable is used by Cygwin
applications as a list of directories to search for executable files
to run.  This environment variable is converted from Windows format
(e.g. <filename>C:\WinNT\system32;C:\WinNT</filename>) to UNIX format
(e.g., <filename>/WinNT/system32:/WinNT</filename>) when a Cygwin
process first starts.
Set it so that it contains at least the <filename>x:\cygwin\bin</filename>
directory where "<filename>x:\cygwin</filename> is the "root" of your
cygwin installation if you wish to use cygwin tools outside of bash.
</para>

<para> 
The <envar>HOME</envar> environment variable is used by many programs to
determine the location of your home directory and we recommend that it be
defined.  This environment variable is also converted from Windows format
when a Cygwin process first starts.  Set it to point to your home directory
before launching bash. 
</para>

<para>
The <envar>TERM</envar> environment variable specifies your terminal
type.  It is automatically set to <literal>cygwin</literal> if you have
not set it to something else.
</para>

<para>The <envar>LD_LIBRARY_PATH</envar> environment variable is used by
the Cygwin function <function>dlopen ()</function> as a list of
directories to search for .dll files to load.  This environment variable
is converted from Windows format to UNIX format when a Cygwin process
first starts.  Most Cygwin applications do not make use of the
<function>dlopen ()</function> call and do not need this variable.
</para>

</sect1>

<sect1 id="setup-files"><title>Customizing bash</title>

<para>
To set bash up so that cut and paste work properly, click on the
"Properties" button of the window, then on the "Misc" tab.  Make sure
that "Quick Edit" is checked and "Fast Pasting" isn't.  These settings
will be remembered next time you run bash from that
shortcut. Similarly you can set the working directory inside the
"Program" tab. The entry "%HOME%" is valid.
</para>

<para>
Your home directory should contain three initialization files
that control the behavior of bash.  They are
<filename>.profile</filename>, <filename>.bashrc</filename> and
<filename>.inputrc</filename>.  These initialization files will only
be read if <envar>HOME</envar> is defined before starting bash.
</para>

<para>
<filename>.profile</filename> (other names are also valid, see the bash man
page) contains bash commands.  It is executed when bash is started as login
shell, e.g. from the command <command>bash --login</command> (the provided
.bat file does not set the switch).  This is a useful place to define and
export environment variables and bash functions that will be used by bash
and the programs invoked by bash.  It is a good place to redefine
<envar>PATH</envar> if needed.  We recommend adding a ":." to the end of
<envar>PATH</envar> to also search the current working directory (contrary
to DOS, the local directory is not searched by default).  Also to avoid
delays you should either <command>unset</command> <envar>MAILCHECK</envar> 
or define <envar>MAILPATH</envar> to point to your existing mail inbox.
</para>

<para>
<filename>.bashrc</filename> is similar to
<filename>.profile</filename> but is executed each time an interactive
bash shell is launched.  It serves to define elements that are not
inherited through the environment, such as aliases. If you do not use
login shells, you may want to put the contents of
<filename>.profile</filename> as discussed above in this file
instead.
</para>

<para>
<screen>
shopt -s nocaseglob
</screen>
will allow bash to glob filenames in a case-insensitive manner.
Note that <filename>.bashrc</filename> is not called automatically for login 
shells. You can source it from <filename>.profile</filename>.
</para>

<para>
<filename>.inputrc</filename> controls how programs using the readline
library (including bash) behave.  It is loaded automatically.  The
full details are in the <filename>readline.info</filename>. 
Due to a bug in the current readline version, 
<filename>.inputrc</filename> cannot contain \r,
even on text mounted systems.
Consider the following settings:
<screen>
# Make Bash 8bit clean
set meta-flag on
set convert-meta off
set output-meta on
# Ignore case while completing
set completion-ignore-case on
</screen>
The first three commands allow bash to display 8-bit characters,
useful for languages with accented characters.  The last line makes
filename completion case insensitive, which can be convenient in a
Windows environment.
</para>

</sect1>