Certain terminals do not have all the capabilities necessary to support the complete vi definition. When these commands cannot be supported on such terminals, this condition shall not produce an error message such as "not an editor command" or report a syntax error. The implementation may either accept the commands and produce results on the screen that are the result of an unsuccessful attempt to meet the requirements of this volume of POSIX.1-2024 or report an error describing the terminal-related deficiency.
When using vi , the terminal screen acts as a window into the editing buffer. Changes made to the editing buffer shall be reflected in the screen display; the position of the cursor on the screen shall indicate the position within the editing buffer.
This reference page uses the term edit buffer to describe the current working text. No specific implementation is implied by this term. All editing changes are performed on the edit buffer, and no changes to it shall affect any file until an editor command writes the file.
The vi (visual) utility is a screen-oriented text editor. Only the open and visual modes of the editor are described in POSIX.1-2024; see the line editor ex for additional editing capabilities used in vi . The user can switch back and forth between vi and ex and execute ex commands from within vi .
This utility shall be provided on systems that both support the User Portability Utilities option and define the POSIX2_CHAR_TERM symbol. On other systems it is optional.
The vi utility shall conform to XBD 12.2 Utility Syntax Guidelines , except that '+' may be recognized as an option delimiter as well as '-' .
See the OPERANDS section of the ex command for a description of the operands supported by the vi command.
If a read from the standard input returns an error, or if the editor detects an end-of-file condition from the standard input, it shall be equivalent to a SIGHUP asynchronous event.
If standard input is not a terminal device, the results are undefined. The standard input consists of a series of commands and input text, as described in the EXTENDED DESCRIPTION section.
See the INPUT FILES section of the ex command for a description of the input files supported by the vi command.
... continue reading