5.0 Using Terminal Emulators

A terminal emulator is an application that displays a window which allows you to use HP-UX commands and cut and paste text within or between terminal emulation windows.

The command line prompt is a special character that is displayed in your terminal emulator after you press Return. It can be a %, $ or other special character. A small box, called a cursor, shows where characters will appear in the window when you type something on the keyboard.

The command line prompt (1), and cursor (2), appear in terminal windows.

HP VUE provides two terminal emulators:

hpterm
hpterm is the default terminal emulator for HP VUE. It displays a window in which command-line prompts and soft keys act like an HP Term0 terminal.
xterm
xterm provides a terminal window that emulates DEC and Tektronix terminals.


5.1 Starting and Stopping a Terminal Emulator

You can start a HP VUE terminal emulator either with a Front Panel control, from the Toolbox, or by typing a command. The method of stopping the terminal emulator is the same, regardless of how it was started.


5.1.1 To start terminal emulator with terminal control

Use the terminal button (1) to start a terminal emulator.

A terminal window containing a command line prompt and cursor appears. The terminal emulator that appears is the default terminal emulator.


5.1.2 To open a terminal from a file manager view

This opens a Terminal Emulator with the same current working directory as the File Manager view where it is started.


5.1.3 To start a terminal emulator from the command line

At the command line prompt, type the name of the terminal emulator and any options you want, using:

hpterm [options] &
Or:
xterm [options] &
Where:

options
Represents optional items to customize the terminal emulator.
&
Specifies that the terminal emulator runs in the background, that is, you can continue working in your original window while the terminal emulator is also running.

The terminal emulator starts in the current workspace unless directed otherwise by options.


5.1.4 To close a terminal emulator window


5.2 Using the terminal emulator

The terminal emulator window provides a means to enter HP-UX commands and the ability to cut and paste text between and within windows.


5.2.1 To cut and paste text

You can select text within one window and copy it to another location within that window, or to another terminal emulator window.

The original text is left in place. if you want to delete it, you must do so manually.

Cutting text

  1. Move the pointer over the first character you want to cut.
  2. Press and hold down the left mouse button.
  3. Drag the pointer over the text you want to move. The text appears highlighted.
  4. Release the mouse button after all the text you want to cut is highlighted.

    The highlighted text is copied to an internal "clipboard". The text is not removed from your original source.

    Pasting text

    1. Position the cursor where you want to insert the text.
    2. Click the middle mouse button.

    A copy of the contents of the clipboard is pasted at the location you indicated. You can make additional copies by repeating the above steps.


    5.2.2 To resize the window contents

     eval `resize`
    You can change the size of the window using the frame components. However, applications running within the window may not know about the resizing and act as if the window were the original size.


    5.2.3 To start applications in a terminal window

    The general syntax for starting an application is:

    application [options] &

    application
    The application name.
    options
    A list of optional information to be passed to the application.
    &
    Indicates that the application runs in the background; that is, you can continue to use the terminal emulator window while the application is also running.

    Example

    The following example starts a digital clock from the command line:

    xclock -digital &


    5.3 Customizing Your Terminal Emulator

    There are several ways in which you can customize your terminal emulator:


    5.3.1 To specify scrollbars

    1. Use the EditResources action to specify a scrollBar resource for the terminal emulator.
    2. Log out, then log back in for the current session. (For home session, set home session, log out, then log back in.)

    If the value of scrollBar is True, the terminal emulator windows will have scrollbars. If the value is False, they will not have scrollbars.

    Example

    The following line sets scrollbars in all hpterm windows:

    hpterm*scrollBar:    True
    The following line sets scrollbars only for hpterm windows named "localTerminal":
    hpterm*localTerminal*scrollBar:   True


    5.3.2 To display a terminal emulator window on another system

    Using -display option

    The -display option has the format:
    -display   host:display.screen
    where:

    host
    is the name of a valid system on the network.
    display
    is the number of the display on the host.
    screen
    is the screen within the display. The default is 0.

    You can find these values by typing env, and examining the DISPLAY line.

    The terminal emulator is running on your system, but the window shows on another system.

    The following starts an hpterm window on the host computer named anna:

    hpterm -display anna:0.1  &

    Using rlogin

    You can use an existing terminal emulator window to log into a remote host. Once the window is acting as a terminal to the remote host, you can run applications there, redirecting the display back to your system if you desire.

    For example, the following command logs onto a system named there, runs the client xload, and redirects the display back to your original system. Assume your system is named here.

    rlogin there
    xload -display here:0.0


    Using remsh

    The remsh command starts a shell on a remote host, performs some client (often starting a terminal emulator on that host), and redirects the display back to your original system if desired. It has the syntax:

    remsh  remote -n client -display system:display.screen
    
    where:
    remote
    The remote host name.
    client
    The program you want to run on the remote host.
    local:display.screen
    The host and display the results are to be displayed on.

    For example, the following command runs xload on the remote host named there, and directs output back to your system, here.

    remsh there -n /usr/bin/X11/xload -display here:0.0
    The remsh command is often used when customizing a menu to access other hosts.


    5.3.3 To set terminal control characters

    1. Use the EditResources action to update the ttyModes resource.
    2. Choose Restart Workspace Manager from the workspace menu.

    Because the hpterm and xterm only emulate a terminal, your control characters might not be what you are used to on a physical terminal. The ttyModes resource allows you to set control characters for you terminal emulator.

    By default, Login Manager sets the following control characters.

    erase
    ^H(backspace erases characters)
    intr
    ^C(interrupt - cancel the current operation and redisplay the command line prompt.)
    kill
    ^U(stop an operation or application)
    start
    ^Q(accept keyboard input - used to "continue" an application that has been paused.)
    stop
    ^S(do not accept keyboard input - used to "pause" an application.)
    swtch
    ^@(switch between layers in a shell.)

    The "^" character stands for the Ctrl key. So to interrupt an operation in progress, you press Ctrl C.

    The syntax for this resource is:

    ttyModes:  ^C  name
    where name is the control, and C is the character. For example, the default value of ttyModes describing the above list is:
    ttyModes: erase ^H intr ^C kill ^U start ^Q stop ^S swtch ^@
    Additional controls are listed in the xterm or hpterm man pages.