Provides a trusted editor with a full screen display.
tvi [ - l ] [ -R ] [ -w Number ] [ -c [ Subcommand ] ] [ File ... ]
The tvi command calls the tvi editor, a trusted version of the vi editor, to edit the file or files specified by the File parameter. Files are edited in the order specified. If you do not provide a file name, the command opens a new file in which you can create text, but if you try to save the text to a file, you are prompted to add a file name to the save command, such as :w File. See the Examples section for more information.
You enter and leave the tvi editor in command mode, but to add or change text, you must enter text input mode. See the description of text input mode for information about the subcommands that initiate text input mode. To leave text input mode, press the Esc key. This returns you to command mode where you can save the text to a file with one of the :w commands, and exit the tvi editor, for example, with the :q command.
Because the full-screen display editor started by the tvi command is based on the ex editor, you can use the ex subcommands within the tvi editor. Subcommands function at the cursor position on the display screen.
The tvi editor makes a copy of the file you are editing in an edit buffer. The contents of the file are not changed until you save the changes.
The maximum limits of the tvi editor assume single-byte characters. The limits are as follows:
The tvi editor operates in the following modes:
command mode | The tvi editor starts in command mode. Any subcommand can be called except those that only correct text during text input mode. To see a description of the subcommands, refer to the topics in Subcommands for the tvi Editor. To identify the subcommands that cannot be called from command mode, refer to Changing Text While in Input Mode. The tvi editor returns to command mode when subcommands and other modes end. Press the Esc key to cancel a partial subcommand. |
text input mode | The tvi editor enters text input mode when you use a permitted command that adds or changes text. To see a list of subcommands that initiate text input mode, refer to Adding Text to a File and the subcommands that change text from command mode, the C subcommand and the cx subcommands. After entering one of these subcommands, you can edit text with any of the subcommands that function in text input mode. To see a description of the subcommands, refer to the topics in "Subcommands for the tvi Editor". To return to command mode from text input mode, press the Esc key for a typical exit or press the Ctrl+C keys to create an INTERRUPT signal. |
last line mode | Some subcommands read input on a line displayed at the bottom of the screen. These subcommands include those with the prefix : (colon), / (slash), and ? (question mark). When you enter the initial character, the tvi editor places the cursor at the bottom of the screen so you can enter the remaining command characters. To run the subcommand, press the Enter key. To cancel the subcommand, press the Ctrl+C keys to create an INTERRUPT signal. When you use the : (colon) to enter last line mode, the following characters have special meaning when used before commands that specify counts: |
You can customize the tvi editor on a temporary basis by following the directions in "Setting vi Editor Options". The section on "Setting vi Options Permanently" is not applicable to the tvi editor.
Information on vi editor subcommands that are applicable to the tvi editor is summarized in the following list:
-c [Subcommand] | Carries out the ex editor subcommand before editing begins. This provides a line-oriented text editor. When a null operand is entered for the Subcommand parameter, as in -c '', the editor places the cursor on the last line of the file. |
-l | Enters the editor in LISP mode. In this mode, the editor indents appropriately for LISP code, and the (, ), {, }, [[, and ]] subcommands are modified to act appropriately for LISP. These subcommands place the cursor at the specified LISP function. For more information on the LISP subcommands, refer to Moving to Sentences, Paragraphs, and Sections. |
-R | Sets the readonly option to protect the file against overwriting. |
-w Number | Sets the default window size to the value specified by the Number parameter. This is useful when you use the editor over a low-speed line. |
+ [Subcommand] | Same as the -c Subcommand. |
Access Control: This command should grant execute (x) access to all users and have the trusted computing base attribute.
Auditing Events:
Event | Information |
---|---|
TVI | filename |
tvi plans
This command puts the tvi editor into command mode. To add or change text, you must enter text input mode or use a command accepted in command mode. For more information, refer to the description of text input mode.
:w plans
In this example, a file name, such as plans, is needed if you gave the tvi command without specifying a file name. If the file is already named, the :w command would not need the File parameter. If you want to overwrite an existing file, use the :w! File command, specifying the file you want to overwrite with the File parameter.
If you try to save an unnamed file without supplying a file name, the following message appears:
No current filename
If this happens, repeat the :w command with a file name.
:q!
If the editor already is in command mode, you do not need to press the Esc key before giving the quit (q!) command.
/usr/bin/tvi | Contains the tvi command. |
For more information about the identification and authentication of users, discretionary access control, the trusted computing base, and auditing, refer to the Security Administration in AIX 5L Version 5.2 Security Guide.