Skip to content

Compatibility with bash 3.2 - #18

Closed
sio wants to merge 2 commits into
masterfrom
old-bash
Closed

sio wants to merge 2 commits into
masterfrom
old-bash

Conversation

@sio

@sio sio commented Dec 16, 2019 •

Copy link
Copy Markdown
Owner

Work on #8 is being done here.

Progress report

Adding support for bash 3.2 turns out to be pretty tricky. The following problems need to be solved:

  • bash 3.2 does not support -D flag for complete builtin. It allows to call custom completion functions while completing commands that are not known beforehand
    • Were there any workarounds at that time? Or did people just hardcode completions for all possible commands?
    • How did the main bash-completion project work at that time? They've dropped bash < 4.1 in version 1.90
  • bash 3.2 does not have compopt builtin (added in 4.0) - workaround in 1a96dcf
  • readline option show-all-if-ambiguous does not work - seems to be that way only when both menu-complete and show-all-if-ambiguous are in use

Development environment

Here is a Dockerfile for convenient interactive testing on old-bash branch:

FROM ghcr.io/sio/bash-complete-partial-path:bash-3.2

RUN apt-get -y install git && \
    apt-get clean

WORKDIR /workdir
ADD https://gist.github.com/sio/e4f50386ef41188529e176b741132072/raw/Makefile .

ENV PY python3
ENV REPO_BRANCH old-bash

Usage:

$ docker build --rm -t oldbash -
...paste the Dockerfile, send EOF with Ctrl+D...
$ docker run -it oldbash
bash-3.2# make test
...will fetch bash-complete-partial-path, checkout the correct branch and execute automated tests...
bash-3.2# source bcpp/bash_completion && _bcpp --defaults
...to try the completion interactively...

@sio sio added help wanted Extra attention is needed os support labels Dec 16, 2019
@sio

sio commented Jan 17, 2023

Copy link
Copy Markdown
Owner Author

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 Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed on hold os support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant