sio / bash-complete-partial-path

Enhanced file path completion in bash (like in zsh)
Apache License 2.0
54 stars 2 forks source link

OSX error - Bash 3.2 compatibility #8

Closed geekscrapy closed 1 year ago

geekscrapy commented 4 years ago

The following line give me an error when installed on macOS Mojave (10.14.6)

https://github.com/sio/bash-complete-partial-path/blob/11771a516769e17c02314300ae98d586171f7a6b/bash_completion#L306

-bash: complete: -D: invalid option
complete: usage: complete [-abcdefgjksuv] [-pr] [-o option] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [name ...]

Other than that, great work!

sio commented 4 years ago

Thank you for reporting that!

Which version of bash are you using? Paste the output of bash --version please.

Does the completion work fine after showing that error?

I heard that macOS ships very old version of bash by default because of licensing issues, that may be the reason -D flag is not supported. If that is the case we'll need to check the docs for that version and see if there was anything with similar functionality at that time.

geekscrapy commented 4 years ago

Hey,

Bash version:

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.

In regards to if it works normally: I'm afraid I haven't tested it that much, but when I initially installed it out was throwing errors when trying to complete a partially complete element (file or directory I can't remember). But I may have that wrong! I'll enable it again tomorrow and see what happens!

sio commented 4 years ago

Yeah... That's bash from 2007. Very old.

I think it'll be fun tweaking bcpp to work on that, but I'm not sure when I'll get to that. This weekend or the next one maybe.

Bash 3.2 has first appeared in Ubuntu 7.04. It was a fine release, I'm looking forward to launching it in a virtual machine :)

geekscrapy commented 4 years ago

Can confirm it's working now. All except when I do the following: cd /etc

...And then TAB. "etc" is a directory and I would expect it to add the slash and then TAB again to start looping over the files and directories within "etc". But it just stops and doesn't autocomplete. It does this with all directories

sio commented 4 years ago

I confirmed the reported behavior and created a new issue #10 to track that.

I'm glad you've got the completion working :) I'll leave this issue open to investigate compatibility with bash 3.2

sio commented 1 year ago

While this was a fun exercise in software archaeology, adding support for bash 3.2 turned out quite difficult. I do not have enough time and motivation to work on this anymore.

If anyone wishes to pick up where I left, I will gladly review a PR. If you need help getting there, I'm also available for discussion.