\begindata{text,538476856}
\textdsversion{12}
\template{help}
\define{global
}


\chapter{Tm: A Command Window

}
\section{What Tm is

}\leftindent{
Tm is a window in which you type and enter Andrew System and UNIX operating 
system commands.  Tm is similar to the Typescript program, but provides 
additional features to allow the use of full screen programs like 
\italic{\helptopic{vi}} that would otherwise have to be run inside an xterm 
window.  There is also support for special terminal modes, such as raw and 
cbreak modes.  These features make Tm suitable for many applications which 
would otherwise be usable only in an xterm under X11.


In most cases, the commands that you enter in Tm get passed along to the 
shell, a program that interprets commands for the UNIX operating system. 
 You do not have to know more about the shell in order to use Tm.  However, 
if you would \italic{like} to know more about the shell, you can look at 
the \italic{\helptopic{csh}} (C-shell) help document.  Tm can be used as a 
front end to other programs as well, not just the shell.   See the Quick 
Reference section for details.\bold{ }\


}
\section{Starting Tm

}\leftindent{
You can start Tm the same way you start Typescript.  To start Tm 
automatically when you log in, you can put "tm" in your wm.startup 
preference if you run wm.  If you run X11 then consult your local 
documentation on how to start programs automatically when you log in.  You 
can also start Tm (or start an additional Tm) by typing \



\leftindent{tm}


at the command prompt and pressing Enter.  When Tm is ready to accept 
commands, it displays a prompt (normally a percent sign %) which is 
followed by a blank line.  }\



\section{Using Tm

}
\leftindent{To enter a command into Tm, type the command, and press Enter. 
 }\leftindent{ For example, to edit a file called "notes",  you type


\leftindent{ez notes}


at the Tm prompt and press the Enter key.


The Tm window behaves like an EZ window with one exception: only the text 
that appears after the last prompt can be cut or changed.   The other lines 
are, of course, commands that you have already issued which cannot be 
changed (they can, however, be copied).  You can scroll the Tm window 
backward to see the results of previous commands, but if your session with 
Tm gets too long, the earliest commands that you entered are silently 
discarded and you cannot scroll back to them.


\bold{Full screen programs.}  Programs that use the full screen on a normal 
terminal with cursor control sequences, such as emacs and vi (and other 
program that you would normally run under h19 while in the window manager), 
will work in Tm, using the Tm window as the screen.  Tm attempts to tell 
such programs the number of characters that are visible in the window, but 
some programs don't understand this.  If the program displays more 
characters than fit in the window, they are still there, just not 
displayed.  To make them visible, just increase the size of the window. \



\bold{Raw/cbreak mode programs.}  Tm supports programs which use raw or 
cbreak mode.  Certain programs put the terminal into this mode so that they 
can get each keystroke as soon as you press it, instead of letting you type 
in and edit an entire line (these are often the same programs that use the 
full screen for display).  However, in this mode, you won't have any of the 
editing commands you normally have until the program exits or changes back 
in to the normal mode.  The text you type in won't appear bold in these 
programs, either.

}
\section{Advice

}\leftindent{
\bold{Repeating Tm commands.} You can use "Esc =" to repeat commands you 
have issued in the Tm window.  Remember that you should press the Esc key, 
release it, and press the = key when you want to use "Esc =".  If you press 
"Esc =" more than once, the commands you have issued are placed one at a 
time at the current Tm prompt.  If you press "Esc =" too many times and 
skip over the command you wanted, you can go forward again through the 
commands by pressing "Esc \bold{-}" (the Esc key followed by the dash key).


The key sequences "Esc [" and "Esc ]" are similar to "Esc =" and "Esc -", 
except that they look at what you've already typed on the command line and 
find the previous/next command that begins with the same string.


\bold{Using}\bold{ IBM PC }\bold{RT arrow keys.}  You can use the arrow 
keys on the RT keyboard to move the text caret in the Tm window.  The "Page 
Up," "Page Down," "Home", and "End" keys also work, but they scroll the Tm 
rather than moving the text caret.  "Home" moves the text caret to the 
beginning of the current line; "End" moves the text caret to the end of the 
line or to the the position before the window was scrolled.


\bold{Using  o}\bold{ther keybindings.}  There are other keyboard command 
available for use with Tm that may enable you to do certain activities more 
quickly.  See the \italic{\helptopic{tm-keys}} help document for a list of 
them. \


}
\section{Pop-up menu meanings

}
\leftindent{Tm contains at least two pop up menus, Front and Search.  The 
Front and Search menus are system menus that always appear when you press 
both mouse buttons.  Additional menus may also appear when you press the 
mouse buttons if you or system maintainers at your site have installed 
them.  (See the section below, "Setting up your own shell menu" for 
details.) \



Depending on whether text is selected and whether the selected text is 
before or after the prompt, the Front menu may display the \bold{Cut} 
and/or \bold{Copy} menu options in place of \bold{Paste.  Paste }appears 
when no text is selected.


\italic{Front menu: }\


\leftindent{
\bold{Paste}:  copies whatever you have most recently cut or copied from 
any scrollable window to the current cursor position.  You can paste any 
piece of text from any document into the Tm window;  just make sure that 
it's the last thing you cut.  \



\bold{Move}:  moves any previous command you have selected from within the 
Tm window to the last Tm prompt.  This operation is useful if you gave a 
long command early in your session that you want to enter again.  You can 
select it with the mouse cursor and choose Move to copy it into your 
current command line so that you can change it without having to re-type 
the entire command.  Then press the Enter key to enter the command. \



\bold{Execute}:  moves any previous command that you have selected from 
within the Tm window to the last Tm prompt and enters it immediately.  This 
operation saves you some time if you are repeating a previous action 
exactly because you do not have to press the Enter key.  Whereas Move 
copies a previous command to the current prompt but does not enter it, 
Execute copies a previous command to the current prompt and enters it 
automatically.


\bold{Quit}:  exits the Tm program and closes the window.

}
\italic{Termulator menu:}


\leftindent{\bold{Clear:}  discards the record of your previous Tm 
activities.  After clearing the Tm window, you can no longer scroll back 
and see your previous commands.


\bold{Start New Process:}  Kills current process and restarts a new process 
in the same Tm window.  If a process already exists, you will be prompted 
in the message area to confirm the killing and restarting of the process 
before it will occur.

}
\italic{Search menu:}

\leftindent{
\bold{Forward}:  searches in the Tm window from the current cursor position 
forward.   After you choose this option, Tm puts the "Find:" prompt in the 
message region at the bottom of the window.  Type the string that you want 
to search for and press the Enter key.  If any of these characters are in 
the search string


 [ ] * . \\   \



precede each of them with a backslash (the last character in the set above)


\bold{Backward}:  searches in the Tm window from the current cursor 
position backward.}}\leftindent{

}
\section{Setting up your own shell menu

} \leftindent{\


You can specify a shell menu for Tm in three different ways (by using the 
Tm.shmenu preference, by using \italic{-s}, using \italic{-m filename}, or 
creating a file called ".shmenu" in your home directory).  Each way 
requires that you establish a file somewhere containing the specification 
for the new menu(s).  See the Quick Reference section for details on 
specifying your own shell menu file.


If you plan to make permanent additions to your Tm menus that will add to 
the menus provided by the system, you should create a file called ".shmenu" 
in your home directory.   We recommend that you copy the system file 
/usr/andrew/lib/shmenu into your own .shmenu file to keep all of the 
options provided there.  Then, you can edit your .shmenu file to add to the 
menus it provides. \



\bold{Adding an example menu card and menu option.}  Each menu option in a 
shmenu file is defined in the following format:


  \italic{ MenuName}~\italic{Priority},\italic{MenuOption}~\italic{Priority}:\
\italic{command

}
To make a new "Start Editor" option appear on a new menu card called 
"Editor," you would only have to add a line like this one to your own 
.shmenu file and start a new Tm:


   Editor~40,Start Editor~11:ez


The first item on each line is the name of the menu (Editor), followed by 
its priority number (~40).  The first priority number tells Tm where to 
position the menu card in relation to other menus;  the 40 means that the 
Editor menu card will be the fourth menu card in Tm.  The Front menu is 
numbered 10, the Search menu is numbered 20, and the Mail/News menu card is 
numbered 30. \



After the comma comes the menu option as it should appear on the menu 
(Start Editor), followed by a priority number for the entry (~11).  This 
priority number determines where each menu option appears on the menu card; 
the group of options beginning with 10 go at the top.  (Other options with 
priority numbers beginning with 1's like 13, 15 or 19 would be listed in 
the same group as Start Editor in numerical order.)  Differences in the 
tens column (10's to 20's to 30's, up to 99 max.) indicate where blank 
lines should appear between groups of menu options that might follow. 
 After the colon is the command string that is sent to Tm when the menu 
option is chosen.  When the menu option Start Editor is chosen, the command 
string "ez" appears in the Tm with a new line inserted after it to enter 
the command.  It is not possible to prevent the new line from being added 
at the end; it is added by the Tm program itself.

}
\section{Warnings

}\leftindent{
Some programs require you to type Ctrl-D in Tm to terminate their input. 
 Be careful not to type an extra Ctrl-D because it can terminate the 
c-shell process in Tm, forcing you to start a new Tm window.   Ctrl-Z will 
suspend a program running in Tm, but will not affect Tm.


Ctrl-C terminates a running program and Ctrl-\\ terminates it with a dump, 
but neither seems to affect the shell.


If you scroll back to look at previous commands in Tm while running a new 
command, Tm may scroll forward to show output from that command.  This may 
be annoying, but is not harmful.

}
\section{Quick reference

}\leftindent{
\bold{Syntax}


tm [ -F ] [-t \italic{message}] [ -s ] [-m\italic{ filename}]  [ 
\italic{command} [ \italic{arguments} ... ] ]


\bold{Options/arguments}


\bold{-F}  adds a File Menu card similar to the one in EZ, containing the 
options Save As, Set Printer, Print, Preview.  These options allow you to 
save a Tm into a file and print it.


\bold{-t}   inserts the words that you supply into the middle of the Tm 
title bar.  Put titles of more than one word inside quotation marks, like 
this:


  t\leftindent{m  -t  "Your ad here"}


\bold{-s}  installs the shell menu.  This is the default unless you use the 
\italic{command} option to start a Tm containing another program.  To find 
a shell menu, Tm first looks for a path to a shell menu in your preferences 
file.  (Use the \italic{programname}.shmenu preference to set this path). 
 It then looks for a .shmenu file in your home directory.   (If neither of 
these is found, Tm will try to find a system shmenu file, if one is defined 
at your site.)


\bold{-m  \italic{filename} } uses the named file for the shell menu.  This 
option lets you start Tm with an experimental shmenu file from a different 
directory. \



\bold{-r \italic{rows}}  Sets the number of rows on the screen Tm uses. 
 The default is 24.  This is used by non-4.3 systems and programs that 
don't understand dynamic screen resizing on 4.3.


\bold{-c \italic{columns}}  Sets the number of columns on Tm's screen.  The 
default is 80.


\bold{\italic{command} [ \italic{arguments} ... ]}  dedicates a new Tm 
window to running an application with any arguments you provide.  When you 
quit from an application program that you started in this manner, the Tm 
window associated with it disappears.


\bold{P\bold{references}}


Preferences in tm are prefixed with the name of the application, not "tm". 
 Since the default application is csh, you will probably want to prefix 
your preferences with "csh."  For instance:


\bold{\italic{csh}}\bold{\italic{.shmenu: }}\


\leftindent{You can reset this preference with the path to your own shell 
menu file.  (Remember, you can also read a shmenu file by putting a .shmenu 
file in your home directory.  You can then use this preference to override 
that file when needed.)

}}
\section{Related tools}  \



Select (highlight) one of the italicized names and choose "Show Help on 
Selected Word" from the pop-up menu to see the help file for:

\leftindent{
\italic{\helptopic{csh}}                   (more about the c-shell)

\helptopic{\italic{t}\italic{m-keys}}            (keybindings for tm)

\italic{\helptopic{typescript}

\helptopic{typescript-keys}}

}

\begindata{bp,538505984}
\enddata{bp,538505984}
\view{bpv,538505984,1,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: 

Permission to use, copy, modify, and distribute this software and its 

documentation for any purpose is hereby granted without fee, 

provided that the above copyright notice appear in all copies and that 

both that copyright notice, this permission notice, and the following 

disclaimer appear in supporting documentation, and that the names of 

IBM, Carnegie Mellon University, and other copyright holders, not be 

used in advertising or publicity pertaining to distribution of the software 

without specific, written prior permission.



IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 

DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 

SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 

BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 

DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 

OF THIS SOFTWARE.

 $

}}\enddata{text,538476856}
