From 87849d3f6480e405e5d0617a3a8809dd6caac3ff Mon Sep 17 00:00:00 2001 From: angelic-sedition Date: Sat, 14 Feb 2015 15:05:47 -0500 Subject: [PATCH] add --clear option --- tdrop | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tdrop b/tdrop index b884ad7..b412e55 100755 --- a/tdrop +++ b/tdrop @@ -20,6 +20,7 @@ options: -P cmd provide a post command to float the window if necessary -O cmd provide a one time command only for when a dropdown is created/initiated (useful for 'tdrop -c') -W the given program is not a terminal (or lacks an -e flag) (default: assume it IS a terminal) + --clear clear saved window id; useful accidentally make a window a dropdown (e.g. '$ tdrop --clear current') --no-cancel don't cancel auto-showing (default is to prevent this when manually toggling a term after it is auto-hidden) --help print help @@ -44,6 +45,7 @@ oneshot_post="" session_name="" num="" normal_window=false +clearwid=false cancel_auto_show=true term=${*:0-1} while getopts :h:w:x:y:s:n:p:P:O:-:W opt @@ -73,6 +75,7 @@ do post-command) float_post=$OPTARG;; oneshot-post) oneshot_post=$OPTARG;; normal-window) normal_window=true;; + clear) clearwid=true;; no-cancel) cancel_auto_show=false;; help) print_help;; esac;; @@ -219,7 +222,9 @@ toggle_auto_hide() { } if [[ -n $1 ]]; then - if [[ $term == toggle_auto_hide ]]; then + if $clearwid; then + > /tmp/tdrop/"$term$num" + elif [[ $term == toggle_auto_hide ]]; then toggle_auto_hide elif [[ $term == auto_hide ]]; then auto_hide