aboutsummaryrefslogtreecommitdiffstats
path: root/.w3m/cgi-bin/restore_tab.cgi
diff options
context:
space:
mode:
Diffstat (limited to '.w3m/cgi-bin/restore_tab.cgi')
-rwxr-xr-x.w3m/cgi-bin/restore_tab.cgi10
1 files changed, 10 insertions, 0 deletions
diff --git a/.w3m/cgi-bin/restore_tab.cgi b/.w3m/cgi-bin/restore_tab.cgi
new file mode 100755
index 0000000..27b3316
--- /dev/null
+++ b/.w3m/cgi-bin/restore_tab.cgi
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+
+TAB_RESTORE_LIMIT=30
+
+last_tab=$(tail -n 1 ~/.w3m/RestoreTab.txt);
+limit=$(tail -n $TAB_RESTORE_LIMIT ~/.w3m/RestoreTab.txt)
+other_tabs=$(printf "%s" "$limit" | head -n -1);
+printf "%s\r\n" "$other_tabs" > ~/.w3m/RestoreTab.txt;
+printf "%s\r\n" "W3m-control: GOTO $last_tab";
+printf "W3m-control: DELETE PREVBUF\r\n";