Skip to content

Commit

Permalink
break if ^C was pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
nakamuray committed Feb 14, 2011
1 parent cf15303 commit 09f4108
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion filter-select
Expand Up @@ -253,13 +253,19 @@ function filter-select() {
fi

read -k key

if [[ $? != 0 ]]; then
# maybe ^C
key=''
break
fi
done

if [[ '#key' -eq '#\\r' || '#key' -eq '#\\n' ]]; then
LBUFFER="${selected}"
RBUFFER=""

elif [[ '#key' -eq '#\\C-g' ]]; then
elif [[ -z "${key}" || '#key' -eq '#\\C-g' ]]; then
LBUFFER="${orig_lbuffer}"
RBUFFER="${orig_rbuffer}"
fi
Expand Down

0 comments on commit 09f4108

Please sign in to comment.