Copyright (c) 2012-2016 Hyperion Entertainment and contributors.

Command Line Interface

From AmigaOS Documentation Wiki
Jump to: navigation, search

AmigaOS has two primary interfaces user facing interfaces: Graphical User Interface (GUI) and Command Line Interface (CLI).

The CLI is better known as the Shell which provides a mechanism for the user to enter commands to the operating system or user programs. It is a low-level version of the GUI also known as the Workbench. Some commands are unique to the Shell, just as some are unique to the Workbench. In practice, the two user interfaces complement each other with a large amount of overlap. The choice is left to personal taste.

The Shell, its user-supplied commands and responses from the Shell and other programs can be displayed in a Console text window on the screen. Alternatively, the user interface may be via a remote mechanism such as a terminal program running on another computer. Such a remote machine might be connected via a serial interface, a network connection or other means.

Shell Components

There are four components that make up the user's visible Shell console:

  1. Shell,
  2. con-handler,
  3. console.device and
  4. Console preferences editor.

Shell

The Shell is the heart of the group. It is the Shell that writes the command prompt, reads the user input, runs any programs that the user requests on the command line and passes the user's command line options to the program. The Shell passes Read and Write requests (among others) to the con-handler for distribution to the user interface.

con-handler

The con-handler directs the Read and Write requests at a device level, to the Console window, to a serial AUX: device or any other supported interface. The con-handler also performs command and file name completion ("tab-completion"). If the user requests a text window on the screen ("CON:"), the con-handler requests the console device to open and maintain a suitable text window.

console.device

The console device is a device driver like any hardware driver. However, it has no hardware to control, it opens a screen window and reads/writes text to and from that window. It is common to refer to the text window as the Console. The console device translates ANSI standard text and embedded commands into text in the window, including embedded cursor movement and editing commands.

When requested by the user, the console creates and maintains a history of all text displayed in the Console Window. The user can retrieve this history after the Console window has been closed.

The Console supports a menu which can be used to modify some attributes of the screen text, e.g. text colour, font size, etc.

Console Preferences

The Console preferences editor allows the user to set some default attributes of the Console text. These default values can be over-ridden by console menu or application programs. Like any other Preferences editor, changes can be made temporarily or permanently.