Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

NEWSHELL Internal
Purpose: Opens a new Shell window.
Format: NEWSHELL [<window specification>] [FROM <filename>]
Template: WINDOW,FROM
Path: Internal
NEWSHELL opens a new Shell process. The new shell window becomes the currently-selected window and process. The new window has the same current directory, prompt string, path, local environment variables, and stack size as the one from which it was invoked. However each Shell window is independent allowing separate input, output, and program execution.

The window can be sized, dragged, zoomed, and depth adjusted like most other Amiga windows.

To create a custom window, you can include the <window specification> argument. Specify the initial dimensions, location, and title of the window with this syntax:

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 window. Use 'no value' (//) to specify the minimum possible pixels.
  y is the number of pixels from the top of the screen to the top border of the window. Use 'no value' (//) to specify the minimum possible pixels.
  width is the width of the Shell window, in pixels. Use 'no value' (//) to specify the full width of the screen.
  height is the height of the Shell window, in pixels. Use 'no value' (//) to specify the minimum possible height.
  title is the text that appears in the Shell window title bar. If any spaces appear in the title, the entire argument must be enclosed in double quotation marks (").
  options AUTO the window automatically appears when the program needs input or produces output. With the Shell window, it opens for input immediately. The window can only be closed with the ENDCLI or ENDSHELL commands. Selecting the Shell's close gadget closes the window, but it re-opens immediately since it is expecting input.
ALTx/y/w/h the window appears in the specified size and position when the zoom gadget is clicked. The four parameters must be separated with slashes (for example, ALT30/30/200/200).
BACKDROP the window appears on the backdrop, behind all of the Workbench windows. The Shell window cannot be brought to the front of the screen; you have to resize the Workbench windows to see it.
CHARSET the window font will be opened with the specified charset if possible. The charset is specified as a string, (for example, CHARSET=ISO-8859-15.
CLOSE the window has all of the standard gadgets, including a close gadget. This is the default for Shell windows, but you must specify it to get a standard Shell if you use the WINDOW argument.
COLUMNS specifies the number of columns in the window to opened, given as the number of characters rather than as pixels. This option overrides the 'x' parameter of the window specification.
INACTIVE the window opens, but is not made the active window.
NEWLOOKMENUS the window will open with the WFLG_NEWLOOKMENUS flag set which affects the menu color scheme. Normally this option is only set by applications which want to add a menu with the GTMN_NewLookMenus flag to the window.
NOBORDER the window opens without any left or bottom window border. Only the zoom, depth, and sizing gadgets are available.
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.
ROWS specifies the number of rows in the window to opened, given as the number of characters rather than as pixels. This option overrides the 'y' parameter of the window specification.
SCREENpub the window opens on a public screen. The screen must already exist. You must specify the name of the screen after the SCREEN keyword (for example, SCREENpublic_screen_name). If the window is to open on the frontmost public screen, use an * (asterisk) in place of the screen name.
SIMPLE if you enlarge the window, the text expands to fill the newly available space, allowing you to see text that had been scrolled out of the window previously. This is the default for standard Shell windows.
SMART if you enlarge the window, the text does not expand to fill the newly available space. This saves memory.
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.
WINDOW a window previously opened through intuition.library/OpenWindow or intuition.library/OpenWindowTagList should be attached to the new console. The window's address must be given as a parameter, which must be given as a hexadecimal number (any leading "0x" prefix is ignored).

NEWSHELL uses the default startup file 'S:Shell-startup', unless a FROM <file name> is specified. S:Shell-startup is a standard AmigaDOS script file. For example, you can have several different Shell-startup files, each having different command aliases. You can call such customised Shell environments with FROM.

The NEWCLI command has the same effect as NEWSHELL; it invokes a new Shell process.

Example 1:

3.OS4:> NEWSHELL Opens a new Shell window with the default window specification.

Example 2:

3.OS4:> NEWSHELL "CON://640/200/My Shell/CLOSE" Opens a new Shell window starting in the upper left hand corner of the screen and measuring 640 pixels wide and 200 pixels high. The window is titled 'My Shell' and it has a close gadget. The entire argument is enclosed in quotation marks because the title contains a space. If you add the command to your User-startup file, a Shell window opens automatically when your Amiga is booted.

Example 3:

3.OS4:> NEWSHELL FROM S:Programming.startup Opens a new Shell, but instead of executing the S:Shell-startup file, the S:Programming.startup file is executed. You can have aliases and prompt commands in the S:Programming.startup file that are only used when you are programming.

Using NewShell
When NEWSHELL is run a screen similar to the following will be displayed:

EDITING
You can simply type into the window, but to simplify entering and editing command line text, the console window provides the following editing key and key combination options:
left arrow moves the cursor one character to the left.
right arrow moves cursor one character to the right.
Shift+left arrow moves cursor to the beginning of the line.
Shift+right arrow moves cursor to the end of the line.
Backspace deletes the character to the left of the cursor.
Del deletes the character highlighted by the cursor.
Ctrl+H deletes the last character (same as Backspace).
Ctrl+M processes the command line (same as Return).
Ctrl+J adds a line feed.
Ctrl+W deletes the word to the left of the cursor.
Ctrl+X deletes the current line.
Ctrl+K deletes everything from the cursor forward to the end of the line.
Ctrl+Y replaces the characters deleted with Ctrl+K.
Ctrl+U deletes everything from the cursor backward to the start of the line.
In addition, the console supports the following keys and key combinations:
Space bar
(or any printable character)
suspends output (stops scrolling).
Backspace resumes output (continues scrolling).
Ctrl+C if the console window is attached to a Shell, sends a BREAK command to the current process (halts the process).
Ctrl+D if the console window is attached to a Shell, sends at BREAK command to the current script (halts the script).
Ctrl+F activates and brings Workbench program windows to the front. (Only if the console window is attached to a Shell and a command is active which responds to the Ctrl+F signal.)
Ctrl+S suspends output.
Ctrl+Q resumes output if it was suspended with Ctrl+S.
Ctrl+\ Closes the console window (equivalent to ENDSHELL).
COPYING AND PASTING
You can copy and paste information from one console window. Use the mouse to highlight the area of text to be copied and pasted. Highlight the text to be copied by moving the pointer to the beginning of the text area, holding down the selection button, and dragging the mouse pointer to the end of the desired text. Release the selection button and press Right Amiga+C. The highlighted area is copied into the Clipboard and the area is unhighlighted. The text you copied can be repeatedly pasted into any application window that supports reading text from the Clipboard, such as the Shell, ED, and MEmacs.

WORKBENCH ICON OPERATIONS
Icons can be dragged and dropped into a console window. The names of the icons will be inserted behind the cursor; directories will have a slash (/) added behind their names. If more than one icon is dropped into a console window, their names will be separated by blank spaces.

NAME COMPLETION
This feature is most useful with a Shell attached to the console window. Instead of entering the complete name of a file, directory or volume, you can type only part of the name and have the console handler fill in the missing pieces. For example, assume that there are three files called "find", "fill" and "file" stored in the RAM disk. Enter "RAM:f" and hit the Tab key. The contents of the RAM disk will be examined, and three files will be found which begin with the letter "f". The results will be sorted alphabetically and first matching name will replace the letter "f", showing you "RAM:file". To cycle through all matching names, hit the Tab key again; to cycle through the names in reverse order, hit Shift+Tab.

Where the cursor is located when you hit the Tab key determines which parts of the file names have to match for the file name completer to pick them. In the previous example, if you had entered "RAM:e" and moved the cursor in front of the letter "e", only names which would end on the letter "e" would have been selected (in this case, only the name "file" would have matched). If you had entered "RAM:fid" and moved the cursor behind the letter "i" and hit Tab, only names which would start with the letter "fi" and end with the letter "d" would have been selected (in this case, only the name "find" would have matched).

If more than one name matches your selection, the screen will flash, indicating that you can hit Tab or Shift+Tab to cycle through all possible matches. If, however, only one single name matches, then the screen will not flash. The name will be inserted at the cursor position and the cursor will be moved behind it.

The file name completion process will try to match your partial name against the names of volumes, drawers and files. If none is found to match, your input will remain unchanged. You can hit a key at any time to abort the search for a matching name.

Note that the file name completer will be disabled if the console window has been switched into single character input mode, or was opened through the "RAW:" rather than the "CON:" device name.

EXITING THE SHELL
To exit a Shell, you can use one of the following:

  • select the Shell's close gadget which closes the window, but if the AUTO option has been specified it will re-open immediately since it is expecting input.
  • type ENDCLI.
  • type ENDSHELL.
  • press Ctrl+\.

Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.