xref: /freebsd/contrib/tcsh/FAQ (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1     * Home
2     * FAQ
3     * Y2K
4     __________________________________________________________________
5
6FAQ
7
8   For the people who do not read the manual!
9
10  Why is the meta key broken in tcsh-5.20 and up?
11
12   On some machines the tty is not set up to pass 8 bit characters by
13   default. Tcsh 5.19 used to try to determine if pass8 should be set by
14   looking at the terminal's meta key. Unfortunately there is no good way
15   of determining if the terminal can really pass 8 characters or not.
16   Consider if you are logged in through a modem line with 7 bits and
17   parity and your terminal has a meta key. Then tcsh 5.19 would set
18   wrongly set pass8.
19
20   If you did like the previous behavior you can add in /etc/csh.login, or
21   in .login:
22    if ( $?tcsh && $?prompt ) then
23        if ( "`echotc meta`" == "yes" ) then
24             stty pass8
25        endif
26    endif
27
28   If you don't have pass8, maybe one of these would work:
29    stty -parity -evenp -oddp cs8 -istrip   (rs6000)
30    stty -parenb -istrip cs8
31
32   Finally, tcsh will bind all printable meta characters to the self
33   insert command. If you don't want that to happen (i.e. use the
34   printable meta characters for commands) setenv NOREBIND.
35
36  I ran dbxtool & and shelltool & from tcsh, and they end up in cbreak and no
37  echo mode?
38
39   These programs are broken. Background jobs should not try to look at
40   the tty. What happens is that dbxtool looks in stderr to inherit the
41   tty setups, but tcsh sets up the tty in cbreak and -echo modes, so that
42   it can do line editing. This cannot be fixed because tcsh cannot give
43   away the tty. Pick one of the following as a workaround:
44    dbxtool < /dev/null >& /dev/null &
45    /usr/etc/setsid dbxtool &
46
47   If that does not work, for dbxtool at least you can add sh stty sane in
48   your .dbxinit file.
49
50  I tried to compile tcsh and it cannot find <locale.h>?
51
52   Your system does not support NLS. Undefine NLS in config_f.h and it
53   should work fine.
54
55  Where can I get csh sources?
56
57   Csh sources are now available with the 4.4BSD networking distributions.
58   You don't need csh sources to compile tcsh-6.0x.
59
60  I just made tcsh my login shell, and I cannot ftp any more?
61
62   Newer versions of the ftp daemon check for the validity of the user's
63   shell before they allow logins. The list of valid login shells is
64   either hardcoded or it is usually in a file called /etc/shells. If it
65   is hard-coded, then you are out of luck and your best bet is to get a
66   newer version of ftpd. Otherwise add tcsh to the list of shells. (For
67   AIX this file is called /etc/security/login.cfg.) Remember that the
68   full path is required. If there is no /etc/shells, and you are creating
69   one, remember to add /bin/csh, /bin/sh, and any other valid shells for
70   your system, so that other people can ftp too.
71
72  I am using SunView or OpenWindows and editing is screwed up. In particular my
73  arrow keys and backspace don't work right. What am I doing wrong?
74
75   Well, cmdtool tries to do its own command line editing and the effect
76   you get is one of using an editor inside an editor. Both try to
77   interpret the arrow key sequences and cmdtool wins since it gets them
78   first. The solutions are in my order of preference:
79     * Don't use suntools
80     * Use shelltool instead of cmdtool.
81     * Unset edit in tcsh.
82
83  On a SPARCstation running Solaris 2.x and OpenWindows 3.1, inside a cmdtool,
84  the short-cut key sequence to clear log (i.e. Meta-e or Diamond-e) doesn't
85  work: it just echos ‘e’; or
86
87   Unset edit in tcsh.
88
89  On a SPARCstation running Solaris 2.x and OpenWindows 3.1, maketool (within
90  SPARCworks) doesn't work: it just does a `cd’ to the working directory then
91  stops.
92
93   Unset edit in tcsh. Using shelltool instead of cmdtool does not fix
94   this.
95
96  I rlogin to another machine, and then no matter what I tell stty I cannot get
97  it to pass 8 bit characters?
98
99   Maybe you need to use rlogin -8 to tell rlogin to pass 8 bit
100   characters.
101
102  Where do I get the public domain directory library?
103
104   Anonymous ftp to ftp://prep.ai.mit.edu/pub/gnu/dirent.tar.Z
105
106  I compiled tcsh using gcc, and when I start up it says: tcsh: Warning no
107  access to tty (Invalid Argument). Thus no job control in this shell
108
109   Your <sys/ioctl.h> file is not ansi compliant. You have one of 3
110   choices:
111     * Run fixincludes from the gcc distribution.
112     * Add -traditional to the gcc flags.
113     * Compile with cc.
114
115  I compiled tcsh with the SunOS unbundled compiler and now things get echoed
116  twice.
117
118   It is a bug in the unbundled optimizer. Lower the optimization level.
119
120  How can I use the arrow keys with hpterm?
121
122   Hp terminals use the arrow keys internally. You can tell hpterm not to
123   do that, by sending it the termcap sequence smkx. Since this has to be
124   done all the time, the easiest thing is to put it as an alias for
125   precmd, or inside the prompt:
126    if ($term == "hp") then
127        set prompt="%{`echotc smkx`%}$prompt"
128    endif
129
130   Note that by doing that you cannot use pgup and pgdn to scroll… Also if
131   you are using termcap, replace smkx with ks.
132
133  On POSIX machines ^C and ^Z do not work when tcsh is a login shell?
134
135   Make sure that the interrupt character is set to ^C and suspend is set
136   to ^Z; stty -a will show you the current stty settings; stty intr ^C
137   susp ^Z will set them to ^C and ^Z respectively.
138
139  I am trying to compile tcsh and I am getting compile errors that look like:
140
141    sh.c:???: `STR???' undeclared, outside of functions [gcc]
142    "sh.c", line ???: STR??? undefined [cc]
143
144   You interrupted make, while it was making the automatically generated
145   headers. Type make clean; make
146
147  On the cray, sometimes the CR/LF mapping gets screwed up.
148
149   You are probably logged in to the cray via telnet. Cray's telnetd
150   implements line mode selection the telnet client you are using does not
151   implement telnet line mode. This cause the Cray's telnetd to try to use
152   KLUDGELINEMODE. You can turn off telnet line mode from the cray side by
153   doing a stty -extproc, or you can get the Cray AIC to build a telnetd
154   without KLUDGELINEMODE, or you can compile a new telnet client (from
155   the BSD net2 tape), or at least on the suns use: mode character.
156
157  On AU/X, I made tcsh my startup shell, but the mac desktop is not starting up
158  (no X11 or Finder), and I only get console emulation.
159
160   Add the pathname to tcsh in /etc/shells and everything should work
161   fine.
162
163  On machines that use YP (NIS) tilde expansion might end up in /dev/null
164
165   If this happens complain to your vendor, to get a new version of NIS.
166   You can fix that in tcsh by defining YPBUGS in config.h
167
168  Script on SGI 4.0.5 does not give us a tty, so we cannot have job control.
169
170   Their csh does not have job control either. Try:
171        % script
172        % cat > /dev/tty
173
174  I start tcsh and it takes a couple of minutes to get the prompt.
175
176   You have defined REMOTEHOST and your DNS is not responding. Either
177   undefine REMOTEHOST and recompile or fix your DNS.
178
179  If you need help generating your .cshrc file, check out:
180
181     * https://github.com/tcsh-org/tcsh/blob/master/dot.tcshrc
182     * https://github.com/tcsh-org/tcsh/blob/master/dot.login
183
184  On POSIX systems the kernel will send hup signals to all the processes in the
185  foreground process group if ‘stty hupcl’ is set.
186
187   For example
188    ./tcsh
189    echo $$
190    591
191    ./tcsh
192    kill -6 591
193
194   Will kill everything, since hup will be sent to all tcsh processes. To
195   avoid that you can set stty -hupcl, but it is not recommended.
196
197  When I rsh the meta key stops working on the remote machine.
198
199   Try using rsh -8; this option is undocumented on some systems, but it
200   works. If that does not work, get and use ssh/sshd. You'll be better
201   off from a security point of view anyway.
202
203  Tcsh compiled under hp/ux-10.x does not pass resource limits correctly when
204  ran on hp/ux-11.x systems.
205
206   This is a problem with lack of ABI compatibility between the two
207   systems. The only solution is to recompile.
208
209  Refreshing in command line editing can appear broken on some OS's
210
211   This is because the termcap/terminfo description lies about the ability
212   of the terminal to use tabs. At least on Compaq/DEC Alpha OSF/1 3.x and
213   4.x systems, stty -tabs will cause problems.
214
215  Where can I learn the merits of tcsh vs. bash vs. csh vs. sh etc?
216
217   You can read the manual page section titled [NEW FEATURES] listing
218   features that tcsh adds to csh.
219
220   You can read Tom Christiansen's Csh Programming Considered Harmful, a
221   document advocating that csh (and by extension, tcsh) should not be
222   used for writing shell scripts.
223
224   XXX: Need to find something about bash, but bash is sh-compatible and
225   has many of the same interactive features of tcsh (command completion
226   does not appear to be as flexible, though).
227
228   Curtains up: introducing the Z shell has a pretty good rundown on zsh.
229   Aside from the arguments about csh being evil, tcsh appears to compare
230   well with zsh. Zsh is sh and ksh compatible, with many of the
231   interactive features of tcsh.
232
233  Why does FreeBSD's tcsh do history browsing differently than I expect?
234
235   On FreeBSD, by default, the up arrow is set to history-search-backward,
236   rather than the default up-history. As a result, if you type (part of)
237   a word and press up arrow, you'll see previous commands that match the
238   prefix. Pretty useful, actually, although it takes some getting used
239   to. You can use bindkey to see your settings, and to rebind up & down
240   differently if desired.
241     __________________________________________________________________
242
243   Page content last updated on 2019-12-31
244