diff --git a/gio/completion/gio b/gio/completion/gio index 86a90e585..1e6ef7e8d 100644 --- a/gio/completion/gio +++ b/gio/completion/gio @@ -43,7 +43,8 @@ __gio_location() { if [[ $cur =~ "/"$ ]]; then dir="$cur" elif [[ $cur =~ "/" ]]; then - dir="$(dirname "$cur")/" + # Subtract basename because dirname cmd doesn't work well with schemes + dir=${cur%$(basename "$cur")} fi # List daemon mounts, just if dir is not specified, or looks like scheme