www.delorie.com/gnu/docs/glibc/libc_368.html   search  
 
Buy the book!


The GNU C Library

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17.4.9.1 Characters for Input Editing

These special characters are active only in canonical input mode. See section 17.3 Two Styles of Input: Canonical or Not.

Macro: int VEOF
This is the subscript for the EOF character in the special control character array. termios.c_cc[VEOF] holds the character itself.

The EOF character is recognized only in canonical input mode. It acts as a line terminator in the same way as a newline character, but if the EOF character is typed at the beginning of a line it causes read to return a byte count of zero, indicating end-of-file. The EOF character itself is discarded.

Usually, the EOF character is C-d.

Macro: int VEOL
This is the subscript for the EOL character in the special control character array. termios.c_cc[VEOL] holds the character itself.

The EOL character is recognized only in canonical input mode. It acts as a line terminator, just like a newline character. The EOL character is not discarded; it is read as the last character in the input line.

You don't need to use the EOL character to make RET end a line. Just set the ICRNL flag. In fact, this is the default state of affairs.

Macro: int VEOL2
This is the subscript for the EOL2 character in the special control character array. termios.c_cc[VEOL2] holds the character itself.

The EOL2 character works just like the EOL character (see above), but it can be a different character. Thus, you can specify two characters to terminate an input line, by setting EOL to one of them and EOL2 to the other.

The EOL2 character is a BSD extension; it exists only on BSD systems and the GNU system.

Macro: int VERASE
This is the subscript for the ERASE character in the special control character array. termios.c_cc[VERASE] holds the character itself.

The ERASE character is recognized only in canonical input mode. When the user types the erase character, the previous character typed is discarded. (If the terminal generates multibyte character sequences, this may cause more than one byte of input to be discarded.) This cannot be used to erase past the beginning of the current line of text. The ERASE character itself is discarded.

Usually, the ERASE character is DEL.

Macro: int VWERASE
This is the subscript for the WERASE character in the special control character array. termios.c_cc[VWERASE] holds the character itself.

The WERASE character is recognized only in canonical mode. It erases an entire word of prior input, and any whitespace after it; whitespace characters before the word are not erased.

The definition of a "word" depends on the setting of the ALTWERASE mode; see section 17.4.7 Local Modes.

If the ALTWERASE mode is not set, a word is defined as a sequence of any characters except space or tab.

If the ALTWERASE mode is set, a word is defined as a sequence of characters containing only letters, numbers, and underscores, optionally followed by one character that is not a letter, number, or underscore.

The WERASE character is usually C-w.

This is a BSD extension.

Macro: int VKILL
This is the subscript for the KILL character in the special control character array. termios.c_cc[VKILL] holds the character itself.

The KILL character is recognized only in canonical input mode. When the user types the kill character, the entire contents of the current line of input are discarded. The kill character itself is discarded too.

The KILL character is usually C-u.

Macro: int VREPRINT
This is the subscript for the REPRINT character in the special control character array. termios.c_cc[VREPRINT] holds the character itself.

The REPRINT character is recognized only in canonical mode. It reprints the current input line. If some asynchronous output has come while you are typing, this lets you see the line you are typing clearly again.

The REPRINT character is usually C-r.

This is a BSD extension.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003