(Display Feature Testing): Fix typo.
[bpt/emacs.git] / man / eshell.texi
CommitLineData
572a0c97
JW
1\input texinfo @c -*-texinfo-*-
2
7d97fbf4 3@c "@(#)$Name: $:$Id: eshell.texi,v 1.12 2001/04/19 15:10:31 gerd Exp $"
572a0c97
JW
4
5@c Documentation for Eshell: The Emacs Shell.
e7cff550 6@c Copyright (C) 1999, 2000 Free Software Foundation, Inc.
572a0c97
JW
7
8@c This file is part of GNU Emacs
9
10@c GNU Emacs is free software; you can redistribute it and/or modify it
11@c under the terms of the GNU General Public License as published by the
12@c Free Software Foundation; either version 2 of the License, or (at
13@c your option) any later version.
14
15@c GNU Emacs is distributed in the hope that it will be useful, but
16@c WITHOUT ANY WARRANTY; without even the implied warraonty of
17@c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18@c General Public License for more details.
19
20@c You should have received a copy of the GNU General Public License
21@c along with Eshell; see the file COPYING. If not, write to the Free
22@c Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
23
24@c %**start of header
25@setfilename ../info/eshell
26@settitle Eshell: The Emacs Shell
27@c %**end of header
28
997c7f71 29@dircategory Emacs
572a0c97 30@direntry
dace60cf 31* Eshell: (eshell). A command shell implemented in Emacs Lisp.
572a0c97
JW
32@end direntry
33@setchapternewpage on
34
35@ifinfo
b409f09b
GM
36Copyright @copyright{} 1999, 2000, 2001 Free Software Foundation, Inc.
37
38Permission is granted to copy, distribute and/or modify this document
39under the terms of the GNU Free Documentation License, Version 1.1 or
40any later version published by the Free Software Foundation; with no
41Invariant Sections, with the Front-Cover texts being ``A GNU
42Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
43license is included in the section entitled ``GNU Free Documentation
44License'' in the Emacs manual.
45
46(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
47this GNU Manual, like GNU software. Copies published by the Free
48Software Foundation raise funds for GNU development.''
49
50This document is part of a collection distributed under the GNU Free
51Documentation License. If you want to distribute this document
52separately from the collection, you can do so by adding a copy of the
53license to the document, as described in section 6 of the license.
572a0c97
JW
54@end ifinfo
55
56@synindex vr fn
57@c The titlepage section does not appear in the Info file.
58@titlepage
59@sp 4
60@c The title is printed in a large font.
61@center @titlefont{User's Guide}
62@sp
63@center @titlefont{to}
64@sp
65@center @titlefont{Eshell: The Emacs Shell}
66@ignore
67@sp 2
dace60cf 68@center release 2.4
572a0c97
JW
69@c -release-
70@end ignore
71@sp 3
72@center John Wiegley
73@c -date-
74
75@c The following two commands start the copyright page for the printed
76@c manual. This will not appear in the Info file.
77@page
78@vskip 0pt plus 1filll
b409f09b
GM
79Copyright @copyright{} 1999, 2000, 2001 Free Software Foundation, Inc.
80
81Permission is granted to copy, distribute and/or modify this document
82under the terms of the GNU Free Documentation License, Version 1.1 or
83any later version published by the Free Software Foundation; with no
84Invariant Sections, with the Front-Cover texts being ``A GNU
85Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
86license is included in the section entitled ``GNU Free Documentation
87License'' in the Emacs manual.
88
89(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
90this GNU Manual, like GNU software. Copies published by the Free
91Software Foundation raise funds for GNU development.''
92
93This document is part of a collection distributed under the GNU Free
94Documentation License. If you want to distribute this document
95separately from the collection, you can do so by adding a copy of the
96license to the document, as described in section 6 of the license.
572a0c97
JW
97@end titlepage
98
997c7f71
EZ
99@contents
100
572a0c97
JW
101@c ================================================================
102@c The real text starts here
103@c ================================================================
104
572a0c97 105@ifinfo
7d97fbf4 106@node Top, What is Eshell?, (dir), (dir)
572a0c97
JW
107@top Eshell
108
109This manual documents Eshell, a shell-like command interpretor
dace60cf
JW
110implemented in Emacs Lisp. It invokes no external processes except for
111those requested by the user. It is intended to be a functional
572a0c97 112replacement for command shells such as @command{bash}, @command{zsh},
dace60cf
JW
113@command{rc}, or @command{4dos}; since Emacs itself is capable of
114handling the sort of tasks accomplished by those tools.
115@c This manual is updated to release 2.4 of Eshell.
572a0c97
JW
116@end ifinfo
117
118@menu
219227ea
JW
119* What is Eshell?:: A brief introduction to the Emacs Shell.
120* Installation:: For users of Emacs 20 and XEmacs.
121* Command basics:: The basics of command usage.
122* Commands::
123* Arguments::
124* Input/Output::
125* Process control::
126* Extension modules::
127* Extras and Goodies::
128* Bugs and ideas:: Known problems, and future ideas.
129* Concept Index::
130* Function and Variable Index::
131* Key Index::
572a0c97
JW
132@end menu
133
7d97fbf4 134@node What is Eshell?
572a0c97 135@chapter What is Eshell?
997c7f71
EZ
136@cindex what is Eshell?
137@cindex Eshell, what it is
572a0c97 138
dace60cf 139Eshell is a @dfn{command shell} written in Emacs Lisp. Everything it
219227ea 140does, it uses Emacs' facilities to do. This means that Eshell is as
dace60cf
JW
141portable as Emacs itself. It also means that cooperation with Lisp code
142is natural and seamless.
572a0c97 143
dace60cf 144What is a command shell? To properly understand the role of a shell,
572a0c97
JW
145it's necessary to visualize what a computer does for you. Basically, a
146computer is a tool; in order to use that tool, you must tell it what to
304724c2 147do---or give it ``commands.'' These commands take many forms, such as
572a0c97
JW
148clicking with a mouse on certain parts of the screen. But that is only
149one form of command input.
150
151By far the most versatile way to express what you want the computer to
304724c2
RS
152do is by using an abbreviated language called @dfn{script}. In
153script, instead of telling the computer, ``list my files, please'',
154one writes a standard abbreviated command word---@samp{ls}. Typing
155@samp{ls} in a command shell is a script way of telling the computer
156to list your files.@footnote{This is comparable to viewing the
157contents of a folder using a graphical display.}
dace60cf
JW
158
159The real flexibility of this approach is apparent only when you realize
160that there are many, many different ways to list files. Perhaps you
161want them sorted by name, sorted by date, in reverse order, or grouped
162by type. Most graphical browsers have simple ways to express this. But
163what about showing only a few files, or only files that meet a certain
164criteria? In very complex and specific situations, the request becomes
165too difficult to express using a mouse or pointing device. It is just
166these kinds of requests that are easily solved using a command shell.
572a0c97
JW
167
168For example, what if you want to list every Word file on your hard
169drive, larger than 100 kilobytes in size, and which hasn't been looked
170at in over six months? That is a good candidate list for deletion, when
171you go to clean up your hard drive. But have you ever tried asking your
172computer for such a list? There is no way to do it! At least, not
173without using a command shell.
174
dace60cf
JW
175The role of a command shell is to give you more control over what your
176computer does for you. Not everyone needs this amount of control, and
177it does come at a cost: Learning the necessary script commands to
572a0c97
JW
178express what you want done. A complicated query, such as the example
179above, takes time to learn. But if you find yourself using your
180computer frequently enough, it is more than worthwhile in the long run.
dace60cf 181Any tool you use often deserves the time spent learning to master it.
572a0c97
JW
182@footnote{For the understandably curious, here is what that command
183looks like: But don't let it fool you; once you know what's going on,
184it's easier than it looks: @code{ls -lt **/*.doc(Lk+50aM+5)}.}
185
186As of Emacs 21, Eshell is part of the standard Emacs distribution.
187
188@menu
dace60cf 189* Contributors to Eshell:: People who have helped out!
572a0c97
JW
190@end menu
191
7d97fbf4 192@node Contributors to Eshell
572a0c97 193@section Contributors to Eshell
997c7f71
EZ
194@cindex contributors
195@cindex authors
572a0c97
JW
196
197Contributions to Eshell are welcome. I have limited time to work on
198this project, but I will gladly add any code you contribute to me to
199this package.
200
201The following persons have made contributions to Eshell.
202
203@itemize @bullet
204@item
205Eli Zaretskii made it possible for Eshell to run without requiring
206asynchronous subprocess support. This is important for MS-DOS, which
207does not have such support.@refill
208
209@item
210Miles Bader contributed many fixes during the port to Emacs 21.@refill
211
212@item
213Stefan Monnier fixed the things which bothered him, which of course made
214things better for all.@refill
215
216@item
217Gerd Moellmann also helped to contribute bug fixes during the initial
218integration with Emacs 21.@refill
219
220@item
221Alex Schroeder contributed code for interactively querying the user
222before overwriting files.@refill
223
224@item
225Sudish Joseph helped with some XEmacs compatibility issues.@refill
572a0c97
JW
226@end itemize
227
228Apart from these, a lot of people have sent suggestions, ideas,
229requests, bug reports and encouragement. Thanks a lot! Without you
230there would be no new releases of Eshell.
231
7d97fbf4 232@node Installation
997c7f71
EZ
233@chapter Installation
234@cindex installation
572a0c97 235
dace60cf 236As mentioned above, Eshell comes preinstalled as of Emacs 21. If you're
572a0c97
JW
237using Emacs 20.4 or later, or XEmacs 21, you can download the most
238recent version of Eshell from
d7103dda 239@url{http://www.gci-net.com/users/j/johnw/Emacs/eshell.tar.gz}.
572a0c97 240
dace60cf 241However, if you are using Emacs 21, you may skip this section.
572a0c97 242
997c7f71 243@section Short Form
572a0c97
JW
244
245Here's exactly what to do, with no explanation why:
246
247@enumerate
997c7f71
EZ
248@item
249@samp{M-x load-file RET eshell-auto.el RET}.
250
251@item
252@samp{ESC : (add-to-list 'load-path "<path where Eshell resides>") RET}.
253
254@item
255@samp{ESC : (add-to-list 'load-path "<path where Pcomplete resides>") RET}.
256
257@item
258@samp{M-x eshell RET}.
572a0c97
JW
259
260You should see a version banner displayed.
261
997c7f71
EZ
262@item
263@samp{ls RET}.
572a0c97
JW
264
265Confirm that you see a file listing.
266
997c7f71
EZ
267@item
268@samp{eshell-test RET}.
572a0c97 269
997c7f71 270Confirm that everything runs correctly. Use @kbd{M-x eshell-report-bug} if
572a0c97
JW
271not.
272
997c7f71
EZ
273@item
274@samp{cd $@{dirname (locate-library "eshell-auto")@} RET}.
275
276@item
277@samp{find-file Makefile RET}.
278
279@item
280Edit the Makefile to reflect your site.
281
282@item
283@samp{M-x eshell RET}.
284
285@item
286@samp{make install RET}.
287
288@item
289@samp{find-file $user-init-file RET}.
290
291@item
292Add the following lines to your @file{.emacs} file:
572a0c97
JW
293
294@example
295(add-to-list 'load-path "<directory where you install Eshell>")
296(load "eshell-auto")
297@end example
298
997c7f71
EZ
299@item
300@samp{M-x eshell RET}.
301
302@item
303@samp{customize-option #'eshell-modules-list RET}.
304
305@item
306Select the extension modules you prefer.
307
308@item
309Restart Emacs!
310
311@item
312@samp{M-x info RET m Eshell RET}.
572a0c97
JW
313
314Read the manual and enjoy!
315@end enumerate
316
997c7f71 317@section Long Form
572a0c97
JW
318
319@enumerate
320@item
321Before building and installing Eshell, it is important to test that it
997c7f71 322will work properly on your system. To do this, first load the file
572a0c97
JW
323@file{eshell-auto}, which will define certain autoloads required to run
324Eshell. This can be done using the command @kbd{M-x load-file}, and
325then selecting the file @file{eshell-auto.el}.
326
327@item
328In order for Emacs to find Eshell's files, the Eshell directory must be
329added to the @code{load-path} variable. This can be done within Emacs by
330typing:
331
332@example
333ESC : (add-to-list 'load-path "<path where Eshell resides>") RET
334ESC : (add-to-list 'load-path "<path where Pcomplete resides>") RET
335@end example
336
337@item
338Start Eshell from the distributed sources, using default settings, by
339typing @kbd{M-x eshell}.
340
341@item
342Verify that Eshell is functional by typing @command{ls} followed by
997c7f71 343@key{RET}. You should have already seen a version banner announcing the
572a0c97
JW
344version number of this release, followed by a prompt.
345
346@item
997c7f71 347Run the test suite by typing @command{eshell-test} followed by @key{RET}
572a0c97
JW
348in the Eshell buffer. It is important that Emacs be left alone while
349the tests are running, since extraneous command input may cause some of
350the tests to fail (they were never intended to run in the background).
351If all of the tests pass, Eshell should work just fine on your system.
352If any of the tests fail, please send e-mail to the Eshell maintainer
353using the command @kbd{M-x eshell-report-bug}.
354
355@item
356Edit the file @file{Makefile} in the directory containing the Eshell
219227ea 357sources to reflect the location of certain Emacs directories at your
572a0c97
JW
358site. The only things you really have to change are the definitions of
359@code{lispdir} and @code{infodir}. The elisp files will be copied to
360@code{lispdir}, and the info file to @code{infodir}.
361
362@item
997c7f71
EZ
363Type @kbd{make install} in the directory containing the Eshell sources.
364This will byte-compile all of the @file{*.el} files and copy both the
572a0c97
JW
365source and compiled versions to the directories specified in the
366previous step. It will also copy the info file, and add a corresponding
997c7f71
EZ
367entry to your @file{dir} file----if the program @code{install-info} can
368be found on your system.
572a0c97
JW
369
370If you only want to create the compiled elisp files, but don't want to
997c7f71 371install them, you can type just @kbd{make} instead.
572a0c97
JW
372
373@item
374Add the directory into which Eshell was installed to your
375@code{load-path} variable. This can be done by adding the following
376line to your @file{.emacs} file:
377
378@example
379(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/eshell")
380@end example
381
382The actual directory on your system may differ.
383
384@item
385To install Eshell privately, edit your @file{.emacs} file; to install
386Eshell site-wide, edit the file @file{site-start.el} in your
387@file{site-lisp} directory (usually
388@file{/usr/local/share/emacs/site-lisp} or something similar). In
389either case enter the following line into the appropriate file:
390
391@example
392(load "eshell-auto")
393@end example
394
395@item
396Restart Emacs. After restarting, customize the variable
397@code{eshell-modules-list}. This variable selects which Eshell
398extension modules you want to use. You will find documentation on each
399of those modules in the Info manual.
572a0c97
JW
400@end enumerate
401
997c7f71
EZ
402@cindex documentation, printed version
403@cindex printed version of documentation
572a0c97
JW
404If you have @TeX{} installed at your site, you can make a typeset manual
405from @file{eshell.texi}.
406
407@enumerate
408@item
997c7f71
EZ
409Run @TeX{} by typing @kbd{texi2dvi eshell.texi}. (With Emacs 21.1 or
410later, typing @kbd{make eshell.dvi} in the @file{man/} subdirectory of
411the Emacs source distribution will do that.)
412
572a0c97
JW
413@item
414Convert the resulting device independent file @file{eshell.dvi} to a
415form which your printer can output and print it. If you have a
997c7f71 416postscript printer, there is a program, @code{dvi2ps}, which does that; there
572a0c97 417is also a program which comes together with @TeX{}, @code{dvips}, which
997c7f71
EZ
418you can use. For other printers, use a suitable DVI driver,
419e.g., @code{dvilj4} for LaserJet-compatible printers.
572a0c97
JW
420@end enumerate
421
7d97fbf4 422@node Command basics
219227ea 423@chapter Basic overview
572a0c97 424
219227ea
JW
425A command shell is a means of entering verbally-formed commands. This
426is really all that it does, and every feature described in this manual
427is a means to that end. Therefore, it's important to take firm hold on
428exactly what a command is, and how it fits in the overall picture of
429things.
572a0c97 430
dace60cf
JW
431@menu
432* Commands verbs:: Commands always begin with a verb.
433* Command arguments:: Some verbs require arguments.
434@end menu
435
7d97fbf4 436@node Commands verbs
dace60cf 437@section Commands verbs
572a0c97 438
dace60cf 439Commands are expressed using @dfn{script}, a special shorthand language
219227ea
JW
440computers can understand with no trouble. Script is an extremely simple
441language; oddly enough, this is what makes it look so complicated!
442Whereas normal languages use a variety of embellishments, the form of a
443script command is always:
572a0c97 444
dace60cf 445@example
304724c2 446@var{verb} [@var{arguments}]
dace60cf 447@end example
572a0c97 448
dace60cf
JW
449The verb expresses what you want your computer to do. There are a fixed
450number of verbs, although this number is usually quite large. On the
451author's computer, it reaches almost 1400 in number. But of course,
452only a handful of these are really necessary.
572a0c97 453
dace60cf 454Sometimes, the verb is all that's written. A verb is always a single
219227ea 455word, usually related to the task it performs. @command{reboot} is a
304724c2
RS
456good example. Entering that on GNU/Linux will reboot the
457computer---assuming you have sufficient privileges.
219227ea
JW
458
459Other verbs require more information. These are usually very capable
460verbs, and must be told specifically what to do. The extra information
461is given in the form of @dfn{arguments}. For example, the
462@command{echo} verb prints back whatever arguments you type. It
463requires these arguments to know what to echo. A proper use of
dace60cf 464@command{echo} looks like this:
572a0c97 465
dace60cf 466@example
304724c2 467echo This is an example of using echo!
dace60cf 468@end example
572a0c97 469
219227ea 470This script command causes the computer to echo back: ``This is an
304724c2 471example of using echo!''
572a0c97 472
219227ea
JW
473Although command verbs are always simple words, like @command{reboot} or
474@command{echo}, arguments may have a wide variety of forms. There are
475textual arguments, numerical arguments---even Lisp arguments.
476Distinguishing these different types of arguments requires special
477typing, for the computer to know exactly what you mean.
572a0c97 478
7d97fbf4 479@node Command arguments
dace60cf 480@section Command arguments
572a0c97 481
219227ea
JW
482Eshell recognizes several different kinds of command arguments:
483
484@enumerate
485@item Strings (also called textual arguments)
486@item Numbers (floating point or integer)
487@item Lisp lists
488@item Lisp symbols
489@item Emacs buffers
490@item Emacs process handles
491@end enumerate
492
1fc0f361 493Most users need to worry only about the first two. The third, Lisp lists,
219227ea
JW
494occur very frequently, but almost always behind the scenes.
495
496Strings are the most common type of argument, and consist of nearly any
497character. Special characters---those used by Eshell
1fc0f361
EZ
498specifically---must be preceded by a backslash (@samp{\}). When in doubt, it
499is safe to add backslashes anywhere and everywhere.
219227ea
JW
500
501Here is a more complicated @command{echo} example:
502
503@example
304724c2 504echo A\ Multi-word\ Argument\ With\ A\ \$\ dollar
219227ea
JW
505@end example
506
507Beyond this, things get a bit more complicated. While not beyond the
508reach of someone wishing to learn, it is definitely beyond the scope of
509this manual to present it all in a simplistic manner. Get comfortable
510with Eshell as a basic command invocation tool, and learn more about the
511commands on your system; then come back when it all sits more familiarly
512on your mind. Have fun!
513
7d97fbf4 514@node Commands
219227ea
JW
515@chapter Commands
516
517@menu
518* Invocation::
519* Completion::
520* Aliases::
521* History::
522* Scripts::
7d97fbf4 523* Built-ins::
219227ea
JW
524@end menu
525
248ac71c
JW
526Essentially, a command shell is all about invoking commands---and
527everything that entails. So understanding how Eshell invokes commands
528is the key to comprehending how it all works.
529
7d97fbf4 530@node Invocation
219227ea
JW
531@section Invocation
532
248ac71c
JW
533Unlike regular system shells, Eshell never invokes kernel functions
534directly, such as @code{exec(3)}. Instead, it uses the Lisp functions
535available in the Emacs Lisp library. It does this by transforming the
536command you specify into a callable Lisp form.@footnote{To see the Lisp
537form that will be invoked, type: @samp{eshell-parse-command "echo
538hello"}}
539
540This transformation, from the string of text typed at the command
541prompt, to the ultimate invocation of either a Lisp function or external
542command, follows these steps:
543
544@enumerate
545@item Parse the command string into separate arguments.
546@item
547@end enumerate
548
7d97fbf4 549@node Completion
219227ea
JW
550@section Completion
551
7d97fbf4 552@node Aliases
219227ea
JW
553@section Aliases
554
7d97fbf4 555@node History
219227ea
JW
556@section History
557
7d97fbf4
KG
558Eshell knows a few built-in variables:
559
560@table @code
561
562@item $+
563@vindex $+
564This variable always contains the current working directory.
565
566@item $-
567@vindex $-
568This variable always contains the previous working directory (the
569current working directory from before the last @code{cd} command).
570
571@end table
572
573@node Scripts
219227ea
JW
574@section Scripts
575
576
7d97fbf4
KG
577@node Built-ins
578@section Built-in commands
579
580Here is a list of built-in commands that Eshell knows about:
581
582@table @code
583
584@item cd
585@findex cd
586This command changes the current working directory. Usually, it is
587invoked as @samp{cd foo} where @file{foo} is the new working
588directory. But @code{cd} knows about a few special arguments:
589
590When it receives no argument at all, it changes to the home directory.
591
592Giving the command @samp{cd -} changes back to the previous working
593directory (this is the same as @samp{cd $-}).
594
595The command @samp{cd =} shows the directory stack.
596
597With @samp{cd =foo}, Eshell searches the directory stack for a
598directory matching the regular expression @samp{foo} and changes to
599that directory.
600
601@end table
602
603
604@node Arguments
219227ea
JW
605@chapter Arguments
606
607@menu
608* The Parser::
609* Variables::
610* Substitution::
611* Globbing::
612* Predicates::
613@end menu
614
7d97fbf4 615@node The Parser
219227ea
JW
616@section The Parser
617
7d97fbf4 618@node Variables
219227ea
JW
619@section Variables
620
7d97fbf4 621@node Substitution
219227ea
JW
622@section Substitution
623
7d97fbf4 624@node Globbing
219227ea
JW
625@section Globbing
626
7d97fbf4 627@node Predicates
219227ea
JW
628@section Predicates
629
630
7d97fbf4 631@node Input/Output
219227ea
JW
632@chapter Input/Output
633
7d97fbf4 634@node Process control
219227ea
JW
635@chapter Process control
636
637
7d97fbf4 638@node Extension modules
219227ea
JW
639@chapter Extension modules
640
641@menu
642* Writing a module::
643* Module testing::
644* Directory handling::
645* Key rebinding::
646* Smart scrolling::
647* Terminal emulation::
648* Built-in UNIX commands::
649@end menu
650
7d97fbf4 651@node Writing a module
219227ea
JW
652@section Writing a module
653
7d97fbf4 654@node Module testing
219227ea
JW
655@section Module testing
656
7d97fbf4 657@node Directory handling
219227ea
JW
658@section Directory handling
659
7d97fbf4 660@node Key rebinding
219227ea
JW
661@section Key rebinding
662
7d97fbf4 663@node Smart scrolling
219227ea
JW
664@section Smart scrolling
665
7d97fbf4 666@node Terminal emulation
219227ea
JW
667@section Terminal emulation
668
7d97fbf4 669@node Built-in UNIX commands
219227ea
JW
670@section Built-in UNIX commands
671
672
7d97fbf4 673@node Extras and Goodies
219227ea
JW
674@chapter Extras and Goodies
675
7d97fbf4 676@node Bugs and ideas
572a0c97 677@chapter Bugs and ideas
997c7f71
EZ
678@cindex reporting bugs and ideas
679@cindex bugs, how to report them
680@cindex author, how to reach
681@cindex email to the author
572a0c97 682@cindex FAQ
997c7f71 683@cindex problems, list of common
572a0c97
JW
684
685If you find a bug or misfeature, don't hesitate to let me know! Send
997c7f71 686email to @email{johnw@@gnu.org}. Feature requests should also be sent
572a0c97
JW
687there. I prefer discussing one thing at a time. If you find several
688unrelated bugs, please report them separately.
689
690If you have ideas for improvements, or if you have written some
691extensions to this package, I would like to hear from you. I hope you
692find this package useful!
693
694@menu
695* Known problems::
696@end menu
697
7d97fbf4 698@node Known problems
572a0c97 699@section Known problems
997c7f71
EZ
700@cindex known bugs
701@cindex bugs, known
572a0c97 702
219227ea
JW
703Below is complete list of known problems with Eshell version 2.4.1,
704which is the version included with Emacs 21.1.
572a0c97
JW
705
706@table @asis
dace60cf
JW
707@item Differentiate between aliases and functions
708
709Allow for a bash-compatible syntax, such as:
710
711@example
712alias arg=blah
dbdc47a3 713function arg () @{ blah $* @}
dace60cf
JW
714@end example
715
716@item @samp{for i in 1 2 3 @{ grep -q a b && *echo has it @} | wc -l} outputs result after prompt
572a0c97
JW
717
718In fact, piping to a process from a looping construct doesn't work in
719general. If I change the call to @code{eshell-copy-handles} in
720@code{eshell-rewrite-for-command} to use @code{eshell-protect}, it seems
721to work, but the output occurs after the prompt is displayed. The whole
722structured command thing is too complicated at present.
723
724@item Error with @command{bc} in @code{eshell-test}
725
726On some XEmacs system, the subprocess interaction test fails
997c7f71 727inexplicably, although @command{bc} works fine at the command prompt.
572a0c97 728
572a0c97
JW
729@item Eshell does not delete @file{*Help*} buffers in XEmacs 21.1.8+
730
731In XEmacs 21.1.8, the @file{*Help*} buffer has been renamed such that
732multiple instances of the @file{*Help*} buffer can exist.
733
734@item Pcomplete sometimes gets stuck
735
997c7f71
EZ
736You press @key{TAB}, but no completions appear, even though the
737directory has matching files. This behavior is rare.
572a0c97
JW
738
739@item @samp{grep python $<rpm -qa>} doesn't work, but using @samp{*grep} does
740
741This happens because the @code{grep} Lisp function returns immediately,
742and then the asynchronous @command{grep} process expects to examine the
743temporary file, which has since been deleted.
744
745@item Problem with C-r repeating text
746
747If the text @emph{before point} reads "./run", and you type @kbd{C-r r u
748n}, it will repeat the line for every character typed.
749
750@item Backspace doesn't scroll back after continuing (in smart mode)
751
752Hitting space during a process invocation, such as @command{make}, will
753cause it to track the bottom of the output; but backspace no longer
754scrolls back.
755
756@item It's not possible to fully @code{unload-feature} Eshell
757
758@item Menu support was removed, but never put back
759
760@item Using C-p and C-n with rebind gets into a locked state
761
762This happened a few times in Emacs 21, but has been unreproducable
763since.
764
765@item If an interactive process is currently running, @kbd{M-!} doesn't work
766
767@item Use a timer instead of @code{sleep-for} when killing child processes
768
769@item Piping to a Lisp function is not supported
770
771Make it so that the Lisp command on the right of the pipe is repeatedly
772called with the input strings as arguments. This will require changing
dace60cf 773@code{eshell-do-pipeline} to handle non-process targets.
572a0c97
JW
774
775@item Input redirection is not supported
776
dace60cf
JW
777See the above entry.
778
219227ea 779@item Problem running @command{less} without arguments on Windows
dace60cf
JW
780
781The result in the Eshell buffer is:
782
783@example
784Spawning child process: invalid argument
785@end example
786
787Also a new @command{less} buffer was created with nothing in it@dots{}
788(presumably this holds the output of @command{less}).
789
790If @command{less.exe} is invoked from the Eshell command line, the
791expected output is written to the buffer.
792
bbd9b8db
EZ
793Note that this happens on NT-Emacs 20.6.1 on Windows 2000. The term.el
794package and the supplied shell both use the @command{cmdproxy} program
795for running shells.
dace60cf
JW
796
797@item Implement @samp{-r}, @samp{-n} and @samp{-s} switches for @command{cp}
798
799@item Make @kbd{M-5 M-x eshell} switch to ``*eshell<5>*'', creating if need be
800
bbd9b8db 801@item @samp{mv @var{dir} @var{file}.tar} does not remove directories
dace60cf
JW
802
803This is because the tar option --remove-files doesn't do so. Should it
804be Eshell's job?
805
806@item Bind @code{standard-output} and @code{standard-error}
807
808This would be so that if a Lisp function calls @code{print}, everything
809will happen as it should (albeit slowly).
810
811@item When an extension module fails to load, @samp{cd /} gives a Lisp error
812
813@item If a globbing pattern returns one match, should it be a list?
814
815@item Make sure syntax table is correct in Eshell mode
816
817So that @kbd{M-DEL} acts in a predictable manner, etc.
818
819@item Allow all Eshell buffers to share the same history and list-dir
820
821@item There is a problem with script commands that output to @file{/dev/null}
822
823If a script file, somewhere in the middle, uses @samp{> /dev/null},
824output from all subsequent commands is swallowed.
825
826@item Split up parsing of text after @samp{$} in @file{esh-var.el}
827
828Make it similar to the way that @file{esh-arg.el} is structured.
829Then add parsing of @samp{$[?\n]}.
830
831@item After pressing @kbd{M-RET}, redisplay before running the next command
832
833@item Argument predicates and modifiers should work anywhere in a path
834
835@example
836/usr/local/src/editors/vim $ vi **/CVS(/)/Root(.)
837Invalid regexp: "Unmatched ( or \\("
838@end example
839
840With @command{zsh}, the glob above expands to all files named
841@file{Root} in directories named @file{CVS}.
842
dbdc47a3 843@item Typing @samp{echo $@{locate locate@}/bin<TAB>} results in a Lisp error
dace60cf
JW
844
845Perhaps it should interpolate all permutations, and make that the
846globbing result, since otherwise hitting return here will result in
847``(list of filenames)/bin'', which is never valuable. Thus, one could
dbdc47a3 848@command{cat} only C backup files by using @samp{ls $@{identity *.c@}~}.
dace60cf
JW
849In that case, having an alias command name @command{glob} for
850@command{identity} would be useful.
851
dace60cf
JW
852@item Once symbolic mode is supported for @command{umask}, implement @command{chmod} in Lisp
853
854@item Create @code{eshell-expand-file-name}
855
856This would use a data table to transform things such as @samp{~+},
857@samp{...}, etc.
858
859@item Abstract @file{em-smart.el} into @file{smart-scroll.el}
860
861It only really needs: to be hooked onto the output filter and the
862pre-command hook, and to have the input-end and input-start markers.
304724c2 863And to know whether the last output group was ``successful.''
dace60cf
JW
864
865@item Allow for fully persisting the state of Eshell
866
867This would include: variables, history, buffer, input, dir stack, etc.
868
869@item Implement D as an argument predicate
870
871It means that files beginning with a dot should be included in the
872glob match.
873
874@item A comma in a predicate list should mean OR
875
876At the moment, this is not supported.
877
878@item Error if a glob doesn't expand due to a predicate
879
880An error should be generated only if @code{eshell-error-if-no-glob} is
881non-nil.
882
883@item @samp{(+ RET SPC TAB} does not cause @code{indent-according-to-mode} to occur
884
885@item Create @code{eshell-auto-accumulate-list}
886
887This is a list of commands for which, if the user presses @kbd{RET}, the
888text is staged as the next Eshell command, rather than being sent to the
889current interactive process.
890
891@item Display file and line number if an error occurs in a script
892
893@item @command{wait} doesn't work with process ids at the moment
894
895@item Enable the direct-to-process input code in @file{em-term.el}
896
897@item Problem with repeating @samp{echo $@{find /tmp@}}
898
899With smart display active, if @kbd{RET} is held down, after a while it
900can't keep up anymore and starts outputting blank lines. It only
901happens if an asynchronous process is involved@dots{}
902
903I think the problem is that @code{eshell-send-input} is resetting the
904input target location, so that if the asynchronous process is not done
905by the time the next @kbd{RET} is received, the input processor thinks
906that the input is meant for the process; which, when smart display is
907enabled, will be the text of the last command line! That is a bug in
908itself.
909
910In holding down @kbd{RET} while an asynchronous process is running,
911there will be a point in between termination of the process, and the
912running of @code{eshell-post-command-hook}, which would cause
913@code{eshell-send-input} to call @code{eshell-copy-old-input}, and then
914process that text as a command to be run after the process. Perhaps
915there should be a way of killing pending input between the death of the
916process, and the @code{post-command-hook}.
917
918@item Allow for a more aggressive smart display mode
919
920Perhaps toggled by a command, that makes each output block a smart
921display block.
922
923@item Create more meta variables
924
925@table @samp
926@item $!
927The reason for the failure of the last disk command, or the text of the
928last Lisp error.
929
930@item $=
931A special associate array, which can take references of the form
932@samp{$=[REGEXP]}. It indexes into the directory ring.
933@end table
934
935@item Eshell scripts can't execute in the background
936
bbd9b8db 937@item Support zsh's ``Parameter Expansion'' syntax, i.e. @samp{$@{@var{name}:-@var{val}@}}
dace60cf
JW
938
939@item Write an @command{info} alias that can take arguments
940
941So that the user can enter @samp{info chmod}, for example.
942
943@item Create a mode @code{eshell-browse}
944
945It would treat the Eshell buffer as a outline. Collapsing the outline
946hides all of the output text. Collapsing again would show only the
947first command run in each directory
948
949@item Allow other revisions of a file to be referenced using @samp{file@{rev@}}
950
951This would be expanded by @code{eshell-expand-file-name} (see above).
952
953@item Print ``You have new mail'' when the ``Mail'' icon is turned on
954
955@item Implement @kbd{M-|} for Eshell
956
957@item Implement input redirection
958
959If it's a Lisp function, input redirection implies @command{xargs} (in a
960way@dots{}). If input redirection is added, also update the
961@code{file-name-quote-list}, and the delimiter list.
962
bbd9b8db 963@item Allow @samp{#<@var{word} @var{arg}>} as a generic syntax
dace60cf
JW
964
965With the handling of @emph{word} specified by an
966@code{eshell-special-alist}.
967
219227ea 968@item In @code{eshell-veal-using-options}, allow a @code{:complete} tag
dace60cf
JW
969
970It would be used to provide completion rules for that command. Then the
971macro will automagically define the completion function.
972
973@item For @code{eshell-command-on-region}, apply redirections to the result
974
975So that @samp{+ > 'blah} would cause the result of the @code{+} (using
976input from the current region) to be inserting into the symbol
977@code{blah}.
978
979If an external command is being invoked, the input is sent as standard
980input, as if a @samp{cat <region> |} had been invoked.
981
982If a Lisp command, or an alias, is invoked, then if the line has no
983newline characters, it is divided by whitespace and passed as arguments
984to the Lisp function. Otherwise, it is divided at the newline
985characters. Thus, invoking @code{+} on a series of numbers will add
986them; @code{min} would display the smallest figure, etc.
987
988@item Write @code{eshell-script-mode} as a minor mode
989
990It would provide syntax, abbrev, highlighting and indenting support like
991@code{emacs-lisp-mode} and @code{shell-mode}.
992
993@item In the history mechanism, finish the @command{bash}-style support
994
995This means @samp{!n}, @samp{!#}, @samp{!:%}, and @samp{!:1-} as separate
996from @samp{!:1*}.
997
998@item Support the -n command line option for @command{history}
999
1000@item Implement @command{fc} in Lisp
1001
1002@item Specifying a frame as a redirection target should imply the currently active window's buffer
1003
bbd9b8db 1004@item Implement @samp{>@var{func-or-func-list}}
dace60cf
JW
1005
1006This would allow for an ``output translators'', that take a function to
1007modify output with, and a target. Devise a syntax that works well with
1008pipes, and can accomodate multiple functions (i.e., @samp{>'(upcase
1009regexp-quote)} or @samp{>'upcase}).
1010
1011@item Allow Eshell to read/write to/from standard input and output
1012
1013This would be optional, rather than always using the Eshell buffer.
1014This would allow it to be run from the command line (perhaps).
1015
1016@item Write a @command{help} command
1017
bbd9b8db
EZ
1018It would call subcommands with @option{--help}, or @option{-h} or
1019@option{/?}, as appropriate.
dace60cf
JW
1020
1021@item Implement @command{stty} in Lisp
1022
bbd9b8db 1023@item Support @command{rc}'s matching operator, e.g. @samp{~ (@var{list}) @var{regexp}}
dace60cf
JW
1024
1025@item Implement @command{bg} and @command{fg} as editors of @code{eshell-process-list}
1026
1027Using @command{bg} on a process that is already in the background does
1028nothing. Specifying redirection targets replaces (or adds) to the list
1029current being used.
1030
1031@item Have @command{jobs} print only the processes for the current shell
1032
1033@item How can Eshell learn if a background process has requested input?
1034
1035@item Support @samp{2>&1} and @samp{>&} and @samp{2>} and @samp{|&}
1036
1037The syntax table for parsing these should be customizable, such that the
1038user could change it to use rc syntax: @samp{>[2=1]}.
1039
1040@item Allow @samp{$_[-1]}, which would indicate the last element of the array
1041
1042@item Make @samp{$x[*]} equal to listing out the full contents of @samp{x}
1043
1044Return them as a list, so that @samp{$_[*]} is all the arguments of the
1045last command.
1046
1047@item Copy ANSI code handling from @file{term.el} into @file{em-term.el}
1048
1049Make it possible for the user to send char-by-char to the underlying
1050process. Ultimately, I should be able to move away from using term.el
1051altogether, since everything but the ANSI code handling is already part
bbd9b8db
EZ
1052of Eshell. Then, things would work correctly on MS-Windows as well
1053(which doesn't have @file{/bin/sh}, although @file{term.el} tries to use
1054it).
dace60cf
JW
1055
1056@item Make the shell spawning commands be visual
1057
1058That is, make (@command{su}, @command{bash}, @command{telnet},
1059@command{rlogin}, @command{rsh}, etc.) be part of
1060@code{eshell-visual-commands}. The only exception is if the shell is
1061being used to invoke a single command. Then, the behavior should be
1062based on what that command is.
1063
bbd9b8db 1064@item Create a smart viewing command named @command{open}
dace60cf
JW
1065
1066This would search for some way to open its argument (similar to opening
1067a file in the Windows Explorer).
1068
1069@item Alias @command{read} to be the same as @command{open}, only read-only
1070
1071@item Write a @command{tail} command which uses @code{view-file}
1072
1073It would move point to the end of the buffer, and then turns on
1074auto-revert mode in that buffer at frequent intervals---and a
1075@command{head} alias which assums an upper limit of
1076@code{eshell-maximum-line-length} characters per line.
1077
1078@item Make @command{dgrep} load @code{dired}, mark everything, then invoke @code{dired-do-search}
1079
219227ea 1080@item Write mesh.c
dace60cf
JW
1081
1082This would run Emacs with the appropriate arguments to invoke Eshell
1083only. That way, it could be listed as a login shell.
1084
1085@item Use an intangible @code{PS2} string for multi-line input prompts
1086
1087@item Auto-detect when a command is visual, by checking @code{TERMCAP} usage
1088
1089@item The first keypress after @kbd{M-x watson} triggers `eshell-send-input'
1090
1091@item Make @kbd{/} electric
1092
1093So that it automatically expands and corrects pathnames. Or make
1094pathname completion for Pcomplete auto-expand @samp{/u/i/std<TAB>} to
1095@samp{/usr/include/std<TAB>}.
1096
1097@item Write the @command{pushd} stack to disk along with @code{last-dir-ring}
1098
1099@item Add options to @code{eshell/cat} which would allow it to sort and uniq
1100
1101@item Implement @command{wc} in Lisp
1102
1103Add support for counting sentences, paragraphs, pages, etc.
1104
1105@item Once piping is added, implement @command{sort} and @command{uniq} in Lisp
1106
1107@item Implement @command{touch} in Lisp
1108
1109@item Implement @command{comm} in Lisp
1110
1111@item Implement an @command{epatch} command in Lisp
1112
1113This would call @code{ediff-patch-file}, or @code{ediff-patch-buffer},
1114depending on its argument.
1115
1116@item Have an option such that @samp{ls -l} generates a dired buffer
1117
1118@item Write a version of @command{xargs} based on command rewriting
1119
1120That is, @samp{find X | xargs Y} would be indicated using @samp{Y
1121$@{find X@}}. Maybe @code{eshell-do-pipelines} could be changed to
1122perform this on-thy-fly rewriting.
1123
1124@item Write an alias for @command{less} that brings up a @code{view-mode} buffer
1125
bbd9b8db 1126Such that the user can press @key{SPC} and @key{DEL}, and then @key{q}
dace60cf
JW
1127to return to Eshell. It would be equivalent to:
1128@samp{X > #<buffer Y>; view-buffer #<buffer Y>}.
1129
1130@item Make @code{eshell-mode} as much a full citizen as @code{shell-mode}
1131
1132Everywhere in Emacs where @code{shell-mode} is specially noticed, add
1133@code{eshell-mode} there.
1134
1135@item Permit the umask to be selectively set on a @command{cp} target
1136
1137@item Problem using @kbd{M-x eshell} after using @code{eshell-command}
1138
1139If the first thing that I do after entering Emacs is to run
1140@code{eshell-command} and invoke @command{ls}, and then use @kbd{M-x
1141eshell}, it doesn't display anything.
1142
1143@item @kbd{M-RET} during a long command (using smart display) doesn't work
1144
1145Since it keeps the cursor up where the command was invoked.
1146
572a0c97
JW
1147@end table
1148
7d97fbf4 1149@node Concept Index
572a0c97
JW
1150@unnumbered Concept Index
1151
1152@printindex cp
1153
7d97fbf4 1154@node Function and Variable Index
997c7f71
EZ
1155@unnumbered Function and Variable Index
1156
1157@printindex fn
1158
7d97fbf4 1159@node Key Index
572a0c97
JW
1160@unnumbered Key Index
1161
1162@printindex ky
572a0c97 1163@bye