summaryrefslogtreecommitdiffstats
path: root/term-utils
diff options
context:
space:
mode:
authorKarel Zak2011-03-02 14:08:30 +0100
committerKarel Zak2011-03-02 14:08:30 +0100
commit720d1af42e96c2a7c6addb309f2b1975e21f7838 (patch)
treea7c553d540f1700687439e6cc331797c732f4536 /term-utils
parentbuild-sys: move script and scriptreplay to term-utils/ (diff)
downloadkernel-qcow2-util-linux-720d1af42e96c2a7c6addb309f2b1975e21f7838.tar.gz
kernel-qcow2-util-linux-720d1af42e96c2a7c6addb309f2b1975e21f7838.tar.xz
kernel-qcow2-util-linux-720d1af42e96c2a7c6addb309f2b1975e21f7838.zip
build-sys: move reset to term-utils/
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils')
-rw-r--r--term-utils/Makefile.am5
-rw-r--r--term-utils/reset13
-rwxr-xr-xterm-utils/reset.033c11
-rw-r--r--term-utils/reset.145
4 files changed, 74 insertions, 0 deletions
diff --git a/term-utils/Makefile.am b/term-utils/Makefile.am
index 62342d832..1f8a5b84f 100644
--- a/term-utils/Makefile.am
+++ b/term-utils/Makefile.am
@@ -40,3 +40,8 @@ setterm_LDADD = @NCURSES_LIBS@
endif
endif
+if BUILD_RESET
+dist_usrbin_exec_SCRIPTS = reset
+dist_man_MANS += reset.1
+endif
+EXTRA_DIST += README.reset reset.033c
diff --git a/term-utils/reset b/term-utils/reset
new file mode 100644
index 000000000..92d253907
--- /dev/null
+++ b/term-utils/reset
@@ -0,0 +1,13 @@
+#!/bin/sh
+stty sane
+tput clear
+tput rmacs
+tput rmm
+tput rmso
+tput rmul
+tput rs1
+tput rs2
+tput rs3
+bot=$[ ${LINES:-`tput lines`} - 1 ]
+if test "$bot" -le "0"; then bot=24; fi
+tput csr 0 $bot
diff --git a/term-utils/reset.033c b/term-utils/reset.033c
new file mode 100755
index 000000000..fb9834db2
--- /dev/null
+++ b/term-utils/reset.033c
@@ -0,0 +1,11 @@
+#!/bin/sh
+stty sane
+tput clear
+tput rmacs
+tput rmm
+tput rmso
+tput rmul
+tput rs1
+tput rs2
+tput rs3
+echo -e \\033c
diff --git a/term-utils/reset.1 b/term-utils/reset.1
new file mode 100644
index 000000000..1e2f0f301
--- /dev/null
+++ b/term-utils/reset.1
@@ -0,0 +1,45 @@
+.\" Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
+.\" May be distributed under the GNU General Public License
+.TH RESET 1 "10 October 1993" "Linux 0.99" "Linux Programmer's Manual"
+.SH NAME
+reset \- reset the terminal
+.SH SYNOPSIS
+.BR reset
+.SH DESCRIPTION
+.B reset
+calls
+.BR tput (1)
+with the
+.IR clear ,
+.IR rmacs ,
+.IR rmm ,
+.IR rmul ,
+.IR rs1 ,
+.IR rs2 ,
+and
+.I rs3
+arguments. This causes
+.B tput
+to send appropriate reset strings to the terminal based on information in
+.I /etc/termcap
+(for the GNU or BSD
+.BR tput )
+or in the terminfo database
+(for the
+.B ncurses
+.BR tput ).
+This sequence seems to be sufficient to reset the Linux VC's when they
+start printing "funny-looking" characters. For good measure,
+.BR stty (1)
+is called with the
+.I sane
+argument in an attempt to get cooked mode back.
+.SH "SEE ALSO"
+.BR clear (1),
+.BR stty (1),
+.BR tput (1)
+.SH AUTHOR
+Rik Faith (faith@cs.unc.edu)
+.SH AVAILABILITY
+The reset command is part of the util-linux package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux/.