Terminal emulator

A terminal emulator, terminal application, or term, (sometimes also referred to as a tty) X).]] This usually takes the form of a window in which the user can enter commands and view output, or of a fullscreen virtual console. A terminal emulator will generally start the shell that is defined as the login shell for a given user. On Gentoo, the default shell is bash.

After booting, Gentoo will show either a login prompt on a virtual console, by default, or a display manager if one has been set up. See next section about virtual consoles and how to switch between them.

If an X environment has been set up, there are many terminal emulator options available for the user to choose from - see software section.

Virtual consoles and switching
A virtual console (VC), aka virtual terminal (VT), allows for full-screen text-based interaction, via facilities provided directly by the kernel. Gentoo starts with six virtual consoles by default (this can be configured in inittab or with openrc-init). X can be started in a virtual console from the shell, or from a display manager, in which case X is traditionally shown on virtual console number 7. Keyboard shortcuts are used to switch between VCs, and the command exists if needed.

From a text virtual console, it is possible to access the other VCs by pressing the + through + keys on the keyboard. The key ("Windows" key on some keyboards, other times the Command or "Apple" key) will toggle consoles. To switch to the next or previous VC in numerical order, press + or +.

From an X session, the Linux virtual consoles can be accessed with ++ through ++.

If an X session was started from a session manager on virtual console number 7, return to it by pressing ++, otherwise return to a graphical X session by going back to the virtual console on which it was started.

Available software
Popular terminal emulators include:

Interrupt application
In many applications, pressing + will abort the application immediately by sending the SIGINT signal. See Wikipedia article.

Jobs
In many applications, pressing + will suspend the process, and return to the shell while continuing the process in the background. This may be useful for example, for running a command in a shell while in text editor. In many shells, the command will return to the suspended task, and  will list current background jobs.

In many shells, postpending a command with the "&" symbol will start a command directly in the background.

See Wikipedia on Ctrl+z, Wikipedia on job control, Bash docs, fish docs, and zsh docs.

Garbled display
Some actions can leave a terminal in a state unadapted to the normal display of text. For example, if binary information is output to the terminal (say with, or ), some of the data can be interpreted as control characters and modify the terminal's state. Another example would be a program dying and leaving the terminal in an abnormal state.

The problem can usually be fixed by typing the command.

Some shells can be cleared and redrawn by pressing + (lower case L). Pressing + a few times can, in cases, help somewhat. Another option is to use the "" and "" commands.

The command can be used to determine a file's type, to try to avoid outputting binary to a terminal in the first place. The command or a hex editor can be useful to view binary files.

External resources

 * https://www.linusakesson.net/programming/tty/index.php - Detailed history of the TTY.