diff --git a/bwc b/bwc index a3bfd99..0056e16 100755 --- a/bwc +++ b/bwc @@ -67,7 +67,17 @@ main() { # Get a list of matching items echo "Searching for '$searchterm'..." - local logins=$(bw list items --search $searchterm --session $sessionkey) + local logins=$(bw list items \ + --search "$searchterm" \ + --session "$sessionkey" \ + --nointeraction + ) + + if [[ -z $logins ]] ; then + sudo rm $sessionfile + echo "The existing session key is invalid and has been deleted." + exit 0 + fi # Pick one with the fzf local id=$(