This commit is contained in:
Dylan Araps committed 2020-08-04 00:17:56 +03:00
1 parent 27cd83661b
commit 04c51b3dc9
2 files changed
+26 -1

No files matched your search

+1
View File
@@ -39,6 +39,7 @@ h - go up level
g - go to top
G - go to bottom
q - quit
: - cd to <input>
opener
+25 -1
View File
@@ -74,6 +74,21 @@ status_line() {
"$LINES" "$COLUMNS" "$1"
}
prompt() {
printf '\0337\033[%sH%s' "$LINES" "$1"
case $2 in
r)
stty icanon echo
read -r ans ||:
stty -icanon -echo
;;
esac
printf '\0338'
status_line "$PWD ($y/$#)"
}
print_line() {
offset=$1
@@ -172,13 +187,22 @@ main() {
redraw "$@"
;;
# broken
G?)
y=$#
y2=$(($# < bottom ? $# : bottom))
redraw "$@"
;;
:?)
prompt "cd: " r
cd "${ans:="$0"}" >/dev/null 2>&1|| continue
set -- *
y=1 y2=1
redraw "$@"
;;
q?)
exit 0
;;