fix cd on exit

This commit is contained in:
Dylan Araps 2020-08-06 13:49:03 +03:00
parent 60ce38bbcf
commit 16d1bd77f7
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
2 changed files with 5 additions and 7 deletions

2
README
View File

@ -71,7 +71,7 @@ rather flexible.
For ease of use, a wrapper function can be added to your .shellrc (.bashrc, etc).
shfm() {
cd "$(command shfm)"
cd "$(command shfm "$@")"
}

10
shfm
View File

@ -31,10 +31,10 @@ term_setup() {
}
term_reset() {
esc DECAWM h
esc DECAWM h >&2
esc DECTCEM h >&2
esc ED2 >&2
esc DECSTBM
esc DECSTBM >&2
stty "$stty"
# needed for cd-on-exit
@ -242,7 +242,7 @@ main() {
;;
-v|--version)
printf 'shfm 0.4\n'
printf 'shfm 0.4.1\n'
exit 0
;;
@ -390,9 +390,7 @@ main() {
status_line "$#"
;;
q?)
exit 0
;;
q?) exit 0 ;;
# handle keys which emit escape sequences
"$esc_c"*) esc=1 ;;