don't embed \033

This commit is contained in:
Dylan Araps 2020-08-03 17:29:52 +03:00
parent 01631abe86
commit dbe7c2dbec
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 5 additions and 3 deletions

8
shfm
View File

@ -56,6 +56,8 @@ main() {
# change directory to the first argument
cd "${1:-"$PWD"}"
esc_char=$(printf '\033')
set -- *
max=$#
@ -105,9 +107,9 @@ main() {
;;
# handle keys which emit escape sequences
''*) esc=1 ;;
'[1') esc=2 ;;
*) esc=0 ;;
"$esc_char"*) esc=1 ;;
'[1') esc=2 ;;
*) esc=0 ;;
esac
done
}