'\"macro stdmacro
.if n .pH g1.psterm @(#)psterm	40.2 of 12/29/89
.ig
Revised: D. Bodnar 9/7/89
format -dqm4 -man6 -rs1 psterm.1
..
.\" @(#)psterm.1 9.3 89/01/21 Copyright 1987 Sun Micro
.nr X
.if \nX=0 .ds x} PSTERM 1 "15 June 1987" "\&"
.if \nX=1 .ds x} PSTERM 1 "15 June 1987"
.if \nX=2 .ds x} PSTERM 1 "" "\&"
.if \nX=3 .ds x} PSTERM "" "" "\&"
.TH \*(x}
.ds Ps P\s-2OST\s+2S\s-2CRIPT\s+2
.ds Sd \s-2Ne\h'-0.2n'WS\s+2
.ds Xn \s-2X11/N\s+2e\h'-0.2n'\s-2WS\s+2
.IX psterm#(1) "" "\fLpsterm\fP(1)"
.SH NAME
psterm \(em \*(Sd terminal emulator
.SH SYNOPSIS
.B psterm
[
\fIoptions\fP
]
[
\fIcommand\fP
]
.IX psterm#(1) "" "\fLpsterm\fP(1) \(em NeWS terminal emulator"
.SH DESCRIPTION
.B psterm
is a \fBtermcap\fP-based
terminal emulator program for \*(Sd.  When invoked,  it reads the
.B /etc/termcap
entry for the terminal named by the
.B -t
option, or by the
.B TERM
environment variable, and arranges to emulate the behavior of that
terminal.  It forks an instance of
.I command
(or, by default, the program specified by the
.SB SHELL
environment variable, or
.B csh 
if this is undefined),
routing keyboard input to the program and displaying its output.
.LP
.B psterm
scales its font to make the number of rows and columns specified in the 
.B /etc/termcap
entry for the terminal it is emulating fit the size of its window.
It also responds to most of the particular escape sequences that
.B termcap
defines for that terminal.
.SH OPTIONS
.TP
.B \-f
Bring up a reasonably-sized terminal in the lower-left corner of the screen
(or in the location specified with the
.B \-xy
option) instead of having the user define its size and location.
.TP
.B \-w
Wait around after the
.I command
terminates.
.TP
.B \-fl "\fIframelabel\fP"
Use the specified string for the frame label.
.TP
.B \-il "\fIiconlabel\fP"
Use the specified string for the icon label.  The icon label normally defaults
to the name of the host on which
.B psterm
is running.
.TP
.B \-li "\fIlines\fP"
Specifies the height of the window in characters.
.TP
.B \-co "\fIcolumns\fP
Specifies the width of the window in characters.
.TP
.B \-xy "\fIx y\fP"
Specifies the location of the lower left hand corner of the
window (in screen pixel coordinates).
.TP
.B \-bg
Causes
.B psterm
to place itself in the background by
disassociating itself from the parent process and the controlling terminal.
If
.B psterm
is invoked with
\fBrsh\fP(1),
this option will cause the
\fBrsh\fP command to complete immediately, rather than hang around until
.B psterm
exits.
.TP
.B \-ls
causes
.B psterm
to invoke the shell as a login shell.  In addition, any
specified
.I command
will be passed to the shell with a
.B \-c
option,
rather than being invoked directly, so that the shell can establish any
environment variables that may be needed by the command.  Further, if
.B psterm
is invoked via
\fBrsh\fP(1),
the host at the other end of the
.B rsh
socket will be used as the server, unless a 
.SB NEWSSERVER
environment variable is present.
.TP
.B \-pm
Specifies that a 
.B psterm
should enable 
.IR "page mode" .
When page mode is enabled and a command produces
more lines of output that can fit on the screen at once,
.B psterm
will stop scrolling, hide the cursor, and wait until the
user types a character before resuming output.  
When 
.B psterm
is blocked with a screenful of data,
typing a carriage return or space will cause
scrolling to proceed by one line or one screenful, respectively; any other
character will cause the next screenful
to appear and be passed through as normal
input.  
This mode can also be enabled or disabled interactively, using the
.I "Page Mode"
menu item.
.TP
.B \-t
Specifies the terminal type, which can be identified by
the name of its \fBtermcap\fP entry.
For example:
.sp
.nf
	\fBexample%  \fBpsterm -t sun\fP
	\fBexample%  \fBpsterm -t vt100\fP
.fi
.sp
.TP
.B \-fontsize "\fIsize\fP"
Specifies the point size of the font to be used when \fBpsterm\fP is being
brought up in fixed size mode (see the 
.B -f
option).  The default size is 12 points.
.SH "SELECTION"
.LP
Clicking the left mouse button over a character selects that character.
Clicking it beyond the end of the line
selects the newline at the end of that line.
Clicking the middle mouse button over a character
when a primary selection does not exist in that window
selects that character.
Clicking the middle mouse button over a character
when a primary selection does exist in that window
extends or shrinks the selection to that character.
Pressing the left button and dragging the pointer over the
text selects the text between the original press location and
the current mouse location.  Pressing the left button over previously
select text and then dragging invokes the 
.SM OPEN LOOK\s+1-style
\fIdrag and drop\fP selection mechanism.
.LP
The \fBCopy\fP key (\fBL6\fP) copies the 
.I primary
selection to the
.IR shelf .
The \fBPaste\fP key (\fBL8\fP) copies the contents of the
.I shelf
to the
.I "insertion point".
.LP
If you make a selection while holding down the \fBCopy\fP key,
the selection will be a secondary selection.
Subsequently letting go of the \fBCopy\fP key
copies the
.I secondary
selection to the
insertion point in the window that had the keyboard focus when the
selection was begun.
.LP
Making a selection while holding down the \fBPaste\fP key
also makes a secondary selection.
It pastes the
.I primary
selection to the location of the 
.\" .I cursor
.\" no matter where the 
secondary selection 
.\" is made,
and deselects the secondary selection.
.LP
\fBCopy\fP and \fBPaste\fP of both primary and secondary selections
work across separate invocations of
.B psterm\fP.
.SH "MENU ITEMS"
.B psterm
adds two items to the top of the standard menu associated with the
right hand mouse button.
These items permit the page mode and
automatic margin modes to be turned on and off.
Menu items change according to the state of each mode.
For example, if page mode is enabled, the menu item will indicate
\fBPage Mode Off\fP.  The \fBAutomatic Margin\fP entry controls the
automatic wrapping of text characters when the text cursor hits the
right terminal margin.  When it is on, the text cursor and characters
are automatically wrapped to the next line.  When it is off, the text
cursor remains at the terminal's right margin and characters overstrike
one another in the last column.
.SH "FONTS"
The 
.B psterm
commands uses a \*(Sd class variable to decide which font to use.
To select a font other than the default (which is \fBCourier\fP), place
the following code in your
.B .startup.ps
file:
.sp
.fH
.ft B
.nf
	UserProfile begin
  	   /ClassPsTermCanvas {
	      begin
	         /TextFamily \f2myfont\f3 store
	      currentdict end
	   } def
	end
.fi
.sp
\f1Here, \fBmyfont\f1 can be 
\fB/Courier\f1, \fB/fixed\f1, or \fB/LucidaSansTypewriter\f1.
Any font that the server can access can be used; however, only
fixed-width fonts work correctly.
.LP
The size of the font used is based on the size of the window.  If the
.B -f
fixed option is used, \fBpsterm\fP starts out at an appropriate size to use
a 12 point version of the specified font family, unless the
.B -fontsize
option is used to specify a different point size.  Even if \fBpsterm\fP is
started in fixed size mode, resizing it causes it to select a new
font size to fit the new-sized window with the original number of rows
and columns.
.SH FILES
.ta \w'/etc/termcap  'u
\fB/etc/termcap\fP to find the terminal description.
.SH "SEE ALSO"
.I "\*(Sd Programmer's Guide"
.SH BUGS
.LP
Emulating some terminal types works better than others, largely because
there are incomplete
.B /etc/termcap
entries for them.
.LP
A large number of
.B termcap
fields have yet to be implemented.
.\" XXX .LP
.\" XXX The font size calculations are based on scaling the width of the font.  If
.\" XXX the height of the window is much less than would be expected from the width
.\" XXX of the window,  there are errors in the font size calculations that may
.\" XXX result in screen dirt from characters with descenders.  If this is a
.\" XXX problem, make the window taller.  This problem can be avoided by using the
.\" XXX .B \-f
.\" XXX option.
.LP
.I "Page Mode"
gets easily confused.
.LP
Resizing \fBpsterm\fP to a size smaller than the fixed startup size for
bitmap fonts such as
.B fixed
causes display-garbage, since \*(Xn cannot scale these fonts.

