Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Terminal emulator
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Unix-like systems === In the past, [[Unix]] and [[Unix-like]] systems used serial port devices such as [[RS-232]] ports, and provided {{Code|/dev/*|text}} [[device file]]s for them.<ref>{{Cite web|title=A Brief History of Terminal Emulation {{!}} Turbosoft|url=https://www.ttwin.com/blog/270-history-terminal-emulation|access-date=2021-10-04|website=www.ttwin.com}}</ref> With terminal emulators these device files are themselves emulated by a pair of [[pseudoterminal]] devices. These in turn emulate a physical port/connection to the host computing endpoint – hardware provided by operating system APIs, or software such as [[rlogin]], [[telnet]] or [[Secure Shell|SSH]], among others.<ref name=":0">{{Cite web|title=Ubuntu Manpage: tty — general terminal interface|url=http://manpages.ubuntu.com/manpages/bionic/man4/tty.4freebsd.html|access-date=2021-10-04|website=manpages.ubuntu.com}}</ref> In Linux systems, example, these would be {{Code|/dev/ptyp0}} (for the master side) and {{Code|/dev/ttyp0}} (for the slave side) pseudoterminal devices respectively. There are also special [[virtual console]] files like <code>/dev/console</code>. In text mode, writing to the file displays text on the virtual console and reading from the file returns text the user writes to the virtual console. As with other [[text terminal]]s, there are also special [[escape sequence]]s, [[control character]]s and [[System call|functions]] that a program can use, most easily via a library such as ''[[ncurses]]''. For more complex operations, the programs can use console and terminal special ''[[ioctl]]'' system calls. One can compare devices using the patterns vcs ("virtual console screen") and vcsa ("virtual console screen with attributes") such as <code>/dev/vcs1</code> and <code>/dev/vcsa1</code>.<ref>{{cite web|title=Screen dumps|url=https://tldp.org/HOWTO/Keyboard-and-Console-HOWTO-20.html|access-date=2008-07-31|work=The Linux keyboard and console HOWTO|publisher=The [[Linux Documentation Project]]|quote=The current contents of the screen of /dev/ttyN can be accessed using the device /dev/vcsN (where `vcs' stands for `virtual console screen'). [...] From a program it is usually better to use /dev/vcsaN (`virtual console screen with attributes') instead - it starts with a header giving the number of rows and columns and the location of the cursor. See vcs(4).}}</ref> Some terminal emulators also include escape sequences for configuring the behavior of the terminal to facilitate good interoperation between the terminal and programs running inside of it, for example to configure [[paste bracketing]]. The virtual consoles can be configured in the file <code>/etc/inittab</code> read by ''[[init]]''—typically it starts the text mode [[Logging (computer security)|login]] process ''[[Getty (Unix)|getty]]'' for several virtual consoles. [[X Window System]] can be configured in <code>/etc/inittab</code> or by an [[X display manager (program type)|X display manager]]. A number of [[Linux]] distributions use [[systemd]] instead of [[init]], which also allows virtual console configuration. ==== CLI tools ==== Typical Linux system programs used to access the virtual consoles include: * {{Code|chvt}} to switch the current virtual console * {{Code|openvt}} to run a program on a new virtual console * {{Code|deallocvt}} to close a currently unused virtual console
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)