mirror of
https://github.com/dylanaraps/shfm.git
synced 2026-11-03 13:18:34 +00:00
don't embed \033
This commit is contained in:
1 file changed
+5
-3
@@ -56,6 +56,8 @@ main() {
|
|||||||
# change directory to the first argument
|
# change directory to the first argument
|
||||||
cd "${1:-"$PWD"}"
|
cd "${1:-"$PWD"}"
|
||||||
|
|
||||||
|
esc_char=$(printf '\033')
|
||||||
|
|
||||||
set -- *
|
set -- *
|
||||||
max=$#
|
max=$#
|
||||||
|
|
||||||
@@ -105,9 +107,9 @@ main() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
# handle keys which emit escape sequences
|
# handle keys which emit escape sequences
|
||||||
''*) esc=1 ;;
|
"$esc_char"*) esc=1 ;;
|
||||||
'[1') esc=2 ;;
|
'[1') esc=2 ;;
|
||||||
*) esc=0 ;;
|
*) esc=0 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user