Copyright (c) Hyperion Entertainment and contributors.

AmigaOS Manual: AmigaDOS Advanced Features

From AmigaOS Documentation Wiki
Revision as of 23:38, 29 January 2014 by Steven Solie (talk | contribs) (Created page with "The information in this appendix is intended for experienced AmigaDOS users. It includes the following: * Customizing the window * Customizing your Shell environment * Using ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The information in this appendix is intended for experienced AmigaDOS users. It includes the following:

  • Customizing the window
  • Customizing your Shell environment
  • Using Escape sequences
  • Customizing startup files

Customizing the Window

The Shell supports a WINDOW Tool Type in the Shell icon that allows you to specify the size, position, and features of the Shell window. The format of the Tool Types is as follows:

WINDOW=CON:x/y/width/height/title/option/options

For a description of the options and arguments for the Shell window specification, see the description of the NEWSHELL command in Chapter 6 and the examples in Chapter 8.

Public Screens - PUBSCREEN Option

Applications creating screens can mark them as public, enabling other applications and utilities to open windows on the same screen. AmigaDOS commands that have PUBSCREEN/K in their templates allow the commands to open windows on public screens.

For example, the Input Preferences editor template contains PUBSCREEN/K; open this editor on a public screen by entering the following:

1> INPUT PUBSCREEN "public screen name"

You must supply the name of the public screen. The internal names for public screens are given by applications and do not necessarily match the screen title printed in the screen's title bar. A screen's name can be the same as the application's name; however, consult the application's documentation to determine if it opens public screens and how it names them.

Customizing the Shell

You can customize your Shell environment by changing the S:Shell-startup file, which is a script that is executed each time a new Shell is opened. You can edit Shell-startup to set up command aliases and to change the Shell prompt.

Using Aliases

An aliases is an abbreviation for a long and/or frequently used command. Aliases can be local or global. Local aliases are entered in a Shell window and are only recognized in that Shell. Global aliases area entered into the Shell-startup file and are recognized by all Shells.

The Alias format is as follows:

ALIAS <name> <string>

where <name> is the alias name to be entered at the Shell prompt to execute a command. The <string> is the command line to be executed.

See Chapter 6 for a full description of the ALIAS command and Chapter 8 for a list of useful aliases.

Changing the Prompt

The PROMPT command lets you customize the Shell prompt. By default, it shows the process number, a period, the current directory, a right angle bracket (>), and a space:

1.Workbench:>

The prompt can display almost anything, with or without the process number and directory information. The return code of the last command executed can be included. The prompt can contain escape sequences, allowing you to change text color and style in the prompt string or clear the screen.

Benefits of customizing your Shell prompt include making the prompt:

  • Easier to distinguish from commands and their output
  • Match a prompt style with which you are familiar
  • More informative
  • Shorter

See Chapter 8 for examples of how to use escape sequences to make the prompt more readable.

Using Escape Sequences

Escape sequences can control how the text appears in a console window, such as the texrt color, style (bold, italics, underline), and margins. AmigaDOS recognizes standard ANSI X3.64 sequences entered on the command line or embedded in strings. Escape sequences consist of one or more characters, sometimes with a numerical argument, prefaced by the escape character. Spaces are not normally used in the sequence of characters.

The escape sequence is shown using the following format:

Esc[#X

where:

Esc Represents the Escape key. Press Esc or substitute *E if you are in an application such as ED that uses the Esc key for its own purposes. When you press Esc, a reversed-color open bracket ([) appears in the console window.
[ Represents the open bracket key, displayed in Figure D-1. If you country's keyboard does not have an open bracket key, press Alt plus the key shown, regardless of what is shown on the keycap.
# Represents a numerical argument.
X Represents an alphabetic key. Escape codes are case-sensitive. If an upper case letter is shown, press Shift and the key. If a lower case letter is shown, press the unshifted key.
Open Bracket Key Location

The standard escape sequences for console windows are: