Copyright (c) Hyperion Entertainment and contributors.

UserDoc:Shell

From AmigaOS Documentation Wiki
Jump to navigation Jump to search

What is a shell?

The Shell/Console is a text based window that provides a mechanism for the user to send commands to the operating system or run user programs. It is a low-level version of the Graphical User Interface (GUI) 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 used 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.

Starting a shell

Opening a Shell with default settings

You can open a shell doing like this:

  • Double click the Shell icon, that you can find in the System folder of the system partition.

TODO: insert icon image

  • Issue one of the following commands newshell, newcli or cli. As an example, you can use such command in the Execute... requester of the Workbench.

Using settings to customise the shell

If you issue the newshell command without an argument, the default value will be used and a shell will be opened positionned at the top left of the screen, with a height of 130 pixels and it will take the width of the screen. The newshell command can be used with a special argument that describes how the shell should look. This is the WINDOW template that looks like this:

CON:[X]/[Y]/[width]/[height]/[title]/[options] where:

X is the number of pixels from the left edge of the screen to the left border of the console window. Use no value (i.e. //) to specify the minimum possible pixels. Use the value -1 to generate a window that is centred horizontally on the screen.

Y is the number of pixels from the top of the screen to the top of the console window. Use no value (//) to specify the minimum possible pixels. Use the value -1 to generate a window that is centred vertically on the screen.

width is the width of the console window, in pixels. Use no value (//) to specify the full width of the screen.

height is the height of the console window, in pixels. Use no value (//) to specify minimum possible height.

title is the text that appears in the console window title bar.

options You can use here any of the following options:

   AUTO
   The window automatically appears when the program needs input
   or produces output. Selecting the Shell's close gadget closes
   the window, but it re-opens immediately since it is expecting
   input.
   CLOSE
   The window has all the standard gadgets, including a close
   gadget.
   NOCLOSE
   The window does not have a close gadget. If you open a console
   normally, there is no close gadget. If you open a console
   using the AUTO option, there is automatically a close gadget
   on the window.
   NODEPTH
   The window has no window depth gadget.
   NODRAG
   The window cannot be dragged. It has zoom, depth and sizing
   gadgets, but no close gadget.
   NOSIZE
   The window only has a depth gadget.
   NOICONIFY
   The window is opened without an iconify gadget. The window can
   still be iconified by use of the Right-Amiga/I keyboard shortcut.
   WAIT
   The window can only be closed by selecting the close gadget or
   entering Ctrl-\. If WAIT is the only option, there is no close
   gadget.

Example:

newshell "CON:0/0//300/This is a shell/CLOSE"

Note: double quotes (") are used because there are spaces in the title string.

Using a shell

A shell being a text only interface you will use it almost exclusively with the keyboard. There are a few graphic elements that will require the use of a mouse: menu items, window sliders, tabs...

TODO: insert shell image with tabs and menus

Menus

Project menu

  • New shell - This allows the user to open a new shell.

  • Load history... - allows you to load a shell history from disk.
  • Save history... - allows to save the history of the current shell into a file.
  • Clear history - clears the current shell history

  • Iconify - this iconifies the shell into an icon on the Workbench screen. The icon will be named with the process ID of the shell.
  • About... - gives the version numbers of the console.device and the console.handler.

  • Close shell - closes the current shell.
  • Close all - closes all shells opened in the current window

Edit menu

  • Copy - copies the selected text into the clipboard.
  • Paste - pastes the text from the clipboard to the shell prompt.

View menu

Settings menu

Extras menu

Command line editing

Typing commands in a shell.