X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fman%2Fclear.1.html;h=43832ee15b1777b0d85bfb32bb205e826ca3e767;hp=162c5d5ed9164eb4b95ddefd9d014d69f6aedcbd;hb=HEAD;hpb=dc690a36a0e53e2c2ecd99c971cd749f78275fdc diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html index 162c5d5e..e7da4da4 100644 --- a/doc/html/man/clear.1.html +++ b/doc/html/man/clear.1.html @@ -1,6 +1,7 @@ -
- --clear(1) clear(1) +clear(1) User commands clear(1) @@ -52,114 +51,113 @@
- clear + clear [-x] [-T terminal-type] + + clear -V
- clear clears your screen if this is possible, including - its scrollback buffer (if the extended "E3" capability is - defined). clear looks in the environment for the terminal - type given by the environment variable TERM, and then in - the terminfo database to determine how to clear the - screen. + clear clears your terminal's screen and its scrollback buffer, if any. + clear retrieves the terminal type from the environment variable TERM, + then consults the terminfo terminal capability database entry for that + type to determine how to perform these actions. - clear writes to the standard output. You can redirect the - standard output to a file (which prevents clear from actu- - ally clearing the screen), and later cat the file to the - screen, clearing it at that point. + The capabilities to clear the screen and scrollback buffer are named + "clear" and "E3", respectively. The latter is a user-defined + capability, applying an extension mechanism introduced in ncurses 5.0 + (1999). - clear ignores any command-line parameters that may be - present. The analogous "tput clear" has command-line - parameters including -T for overriding the TERM environ- - ment variable. +
+ clear recognizes the following options. -
- A clear command appeared in 2.79BSD dated February 24, - 1979. Later that was provided in Unix 8th edition (1985). + -T type produces instructions suitable for the terminal type. + Normally, this option is unnecessary, because the terminal + type is inferred from the environment variable TERM. If this + option is specified, clear ignores the environment variables + LINES and COLUMNS as well. - AT&T adapted a different BSD program (tset) to make a new - command (tput), and used this to replace the clear command - with a shell script which calls tput clear, e.g., + -V reports the version of ncurses associated with this program + and exits with a successful status. - /usr/bin/tput ${1:+-T$1} clear 2> /dev/null - exit + -x prevents clear from attempting to clear the scrollback buffer. - In 1989, when Keith Bostic revised the BSD tput command to - make it similar to the AT&T tput, he added a shell script - for the clear command: - exec tput clear +
+ Neither IEEE Std 1003.1/The Open Group Base Specifications Issue 7 + (POSIX.1-2008) nor X/Open Curses Issue 7 documents clear. - The remainder of the script in each case is a copyright - notice. + The latter documents tput, which could be used to replace this utility + either via a shell script or by an alias (such as a symbolic link) to + run tput as clear. - The ncurses clear command began in 1995 by adapting the - original BSD clear command (with terminfo, of course). - The E3 extension came later: +
+ A clear command using the termcap database and library appeared in 2BSD + (1979). Eighth Edition Unix (1985) later included it. - o In June 1999, xterm provided an extension to the stan- - dard control sequence for clearing the screen. Rather - than clearing just the visible part of the screen - using + The commercial Unix arm of AT&T adapted a different BSD program (tset) + to make a new command, tput, and replaced the clear program with a + shell script that called "tput clear". - printf '\033[2J' + /usr/bin/tput ${1:+-T$1} clear 2> /dev/null + exit - one could clear the scrollback using + In 1989, when Keith Bostic revised the BSD tput command to make it + similar to AT&T's tput, he added a clear shell script as well. - printf '\033[3J' + exec tput clear - This is documented in XTerm Control Sequences as a - feature originating with xterm. + The remainder of the script in each case is a copyright notice. - o A few other terminal developers adopted the feature, - e.g., PuTTY in 2006. + In 1995, ncurses's clear began by adapting BSD's original clear command + to use terminfo. The E3 extension came later. - o In April 2011, a Red Hat developer submitted a patch - to the Linux kernel, modifying its console driver to - do the same thing. The Linux change, part of the 3.0 - release, did not mention xterm, although it was cited - in the Red Hat bug report (#683733) which led to the - change. + o In June 1999, xterm provided an extension to the standard control + sequence for clearing the screen. Rather than clearing just the + visible part of the screen using - o Again, a few other terminal developers adopted the - feature. But the next relevant step was a change to - the clear program in 2013 to incorporate this exten- - sion. + printf '\033[2J' - o In 2013, the E3 extension was overlooked in tput with - the "clear" parameter. That was addressed in 2016 by - reorganizing tput to share its logic with clear and - tset. + one could clear the scrollback buffer as well by using + printf '\033[3J' -
- Neither IEEE Std 1003.1/The Open Group Base Specifica- - tions Issue 7 (POSIX.1-2008) nor X/Open Curses Issue 7 - documents tset or reset. + instead. "XTerm Control Sequences" documents this feature as + originating with xterm. - The latter documents tput, which could be used to replace - this utility either via a shell script or by an alias - (such as a symbolic link) to run tput as clear. + o A few other terminal emulators adopted it, such as PuTTY in 2006. + o In April 2011, a Red Hat developer submitted a patch to the Linux + kernel, modifying its console driver to do the same thing. + Documentation of this change, appearing in Linux 3.0, did not + mention xterm, although that program was cited in the Red Hat bug + report (#683733) motivating the feature. + + o Subsequently, more terminal developers adopted the feature. The + next relevant step was to change the ncurses clear program in 2013 + to incorporate this extension. + + o In 2013, the E3 capability was not exercised by "tput clear". That + oversight was addressed in 2016 by reorganizing tput to share its + logic with clear and tset. -
- tput(1), terminfo(5) - This describes ncurses version 6.0 (patch 20170121). +
+ tput(1), xterm(1), terminfo(5) - clear(1) +ncurses 6.5 2024-03-16 clear(1)