Skip to content

OSX error - Bash 3.2 compatibility #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
geekscrapy opened this issue Nov 5, 2019 · 6 comments
Closed

OSX error - Bash 3.2 compatibility #8

geekscrapy opened this issue Nov 5, 2019 · 6 comments

Comments

@geekscrapy
Copy link

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

[[ -z "$DYNAMIC" ]] && complete -D -F _bcpp_complete_file

-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
Copy link
Owner

sio commented Nov 5, 2019

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
Copy link
Author

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
Copy link
Owner

sio commented Nov 5, 2019

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
Copy link
Author

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 sio changed the title OSX error OSX error - Bash 3.2 compatibility Nov 7, 2019
@sio
Copy link
Owner

sio commented Nov 7, 2019

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 added a commit that referenced this issue Nov 27, 2019
This bash version is provided by default in macOS

This container will be used for working on issue #8
@sio sio added the os support label Dec 3, 2019
@sio sio mentioned this issue Dec 16, 2019
5 tasks
@sio sio added the on hold label Dec 28, 2022
@sio
Copy link
Owner

sio commented Jan 17, 2023

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.

@sio sio closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants