Background execution Background execution allows a shell to run a command without user interaction in the terminal, freeing the command line for additional work with the shell. POSIX shells and other Unix shells allow background execution by using the
& character at the end of command.
Completions .Completion features assist the user in typing commands at the command line, by looking for and suggesting matching words for incomplete ones. Completion is generally requested by pressing the completion key (often the key).
Command name completion is the completion of the name of a command. In most shells, a command can be a program in the command path (usually $PATH), a builtin command, a function or alias.
Path completion is the completion of the path to a file, relative or absolute.
Wildcard completion is a generalization of path completion, where an expression matches any number of files, using any supported syntax for
file matching.
Variable completion is the completion of the name of a variable name (
environment variable or shell variable). Bash, zsh, and fish have completion for all variable names. PowerShell has completions for environment variable names, shell variable names and — from within user-defined functions — parameter names.
Command argument completion is the completion of a specific command's arguments. There are two types of arguments,
named and positional: Named arguments, often called
options, are identified by their name or letter preceding a value, whereas positional arguments consist only of the value. Some shells allow completion of argument names, but few support completing values. Bash, zsh and fish offer parameter name completion through a definition external to the command, distributed in a separate completion definition file. For command parameter name/value completions, these shells assume path/filename completion if no completion is defined for the command. Completion can be set up to dynamically suggest completions by calling a shell function. The fish shell additionally supports parsing of
man pages to extract parameter information that can be used to improve completions/suggestions. In PowerShell, all types of commands (cmdlets, functions, script files) inherently expose data about the names, types and valid value ranges/lists for each argument. This metadata is used by PowerShell to automatically support argument name and value completion for built-in commands/functions, user-defined commands/functions as well as for script files. Individual cmdlets can also define dynamic completion of argument values where the completion values are computed dynamically on the running system.
Command history Users of a shell may find themselves typing something similar to what they have typed before. Support for
command history means that a user can recall a previous command into the command-line editor and edit it before issuing the potentially modified command. Shells that support completion may also be able to directly complete the command from the command history given a partial/initial part of the previous command. Most modern shells support command history. Shells which support command history in general also support completion from history rather than just recalling commands from the history. In addition to the plain command text, PowerShell also records execution start- and end time and execution status in the command history.
Mandatory argument prompt Mandatory arguments/parameters are arguments/parameters which must be assigned a value upon invocation of the command, function or script file. A shell that can determine ahead of invocation that there are missing mandatory values, can assist the interactive user by prompting for those values instead of letting the command fail. Having the shell prompt for missing values will allow the author of a script, command or function to mark a parameter as mandatory instead of creating script code to either prompt for the missing values (after determining that it is being run interactively) or fail with a message.
Automatic suggestions .Shells featuring automatic suggestions display optional command-line completions as the user types. The
PowerShell and
fish shells natively support this feature; pressing the key inserts the completion. Implementations of this feature can differ between shells; for example, PowerShell and
zsh use an external module to provide completions, and fish derives its completions from the user's command history.
Directory history, stack or similar features Shells may record a history of directories the user has been in and allow for fast switching to any recorded location. This is referred to as a "directory stack". The concept had been realized as early as 1978 in the release of
the C shell (csh). Command line interpreters
4DOS and its graphical successor
Take Command Console also feature a directory stack.
Implicit directory change A directory name can be used directly as a command which implicitly changes the current location to the directory. This must be distinguished from an unrelated
load drive feature supported by
Concurrent DOS,
Multiuser DOS,
System Manager and
REAL/32, where the drive letter L: will be implicitly updated to point to the load path of a loaded application, thereby allowing applications to refer to files residing in their load directory under a standardized drive letter instead of under an absolute path.
Autocorrection program. When a command line does not match a command or arguments directly, spell checking can automatically correct common typing mistakes (such as
case sensitivity, missing letters). There are two approaches to this; the shell can either suggest probable corrections upon command invocation, or this can happen earlier as part of a completion or autosuggestion. The
tcsh and
zsh shells feature optional spell checking/correction, upon command invocation. Fish does the autocorrection upon completion and autosuggestion. The feature is therefore not in the way when typing out the whole command and pressing enter, whereas extensive use of the tab and right-arrow keys makes the shell mostly case insensitive. The PSReadLine These are not integrated features of the shells, however.
Colored directory listings JP Software command-line processors provide user-configurable colorization of file and directory names in directory listings based on their file extension and/or attributes through an optionally defined environment variable. For the Unix/Linux shells, this is a feature of the command and the terminal.
Text highlighting The command line processors in
DOS Plus,
Multiuser DOS,
REAL/32 and in all versions of
DR-DOS support a number of optional environment variables to define escape sequences allowing to control text highlighting, reversion or colorization for display or print purposes in commands like
TYPE. All mentioned command line processors support
%$ON% and
%$OFF%. If defined, these sequences will be emitted before and after filenames. A typical sequence for would be in conjunction with
ANSI.SYS, for an
ASCII terminal or for an IBM or
ESC/P printer. Likewise, typical sequences for would be , , , respectively. The variables
%$HEADER% and
%$FOOTER% are only supported by COMMAND.COM in DR-DOS 7.02 and higher to define sequences emitted before and after text blocks in order to control text highlighting, pagination or other formatting options. For the Unix/Linux shells, this is a feature of the terminal.
Syntax highlighting A defining feature of the fish shell is built-in syntax highlighting, As the user types, text is colored to represent whether the input is a valid command or not (the executable exists and the user has permissions to run it), and valid file paths are underlined. An independent project offers syntax highlighting as an add-on to the Z Shell (zsh). This is not part of the shell, however. PowerShell provides customizable syntax highlighting on the command line through the PSReadLine Take Command Console (TCC) offers syntax highlighting in the integrated environment.
Context sensitive help 4DOS, 4OS2, 4NT / Take Command Console and PowerShell (in PowerShell ISE) looks up context-sensitive help information when is pressed. Zsh provides various forms of configurable context-sensitive help as part of its widget, command, or in the completion of options for some commands. The fish shell provides brief descriptions of a command's flags during tab completion. ==Programming features==