]> git.phdru.name Git - dotfiles.git/commitdiff
bin/l: preserve the terminal content
authorOleg Broytman <phd@phdru.name>
Tue, 9 Aug 2022 08:04:30 +0000 (11:04 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 9 Aug 2022 08:04:30 +0000 (11:04 +0300)
Switch to alternate screen.

bin/l

diff --git a/bin/l b/bin/l
index 73a04584a95cbb51493e8ba1048c4eb29c2a99a1..193d6b4ffef00627667e8964599ae7f847e22d7c 100755 (executable)
--- a/bin/l
+++ b/bin/l
@@ -1,14 +1,14 @@
 #! /bin/sh
 
 case "$TERM" in
-   *rxvt*|screen*|*term*|vt100)
-      TERM=xterm
-      export TERM
+    *rxvt*|screen*|*term*|vt100)
 
-      xtitle "links@${HOSTNAME}"
-      exec links2 "$@"
-   ;;
+        xtitle "links@${HOSTNAME}"
+             tput smcup
+             TERM=xterm links2 "$@"
+        exec tput rmcup
+    ;;
 
-   *)echo "Wrong TERM" >&2
-   ;;
+    *)echo "Wrong TERM" >&2
+    ;;
 esac