Skip to content
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

rename /etc/bash_completion.d/glow #664

Open
iconoclasthero opened this issue Dec 20, 2024 · 1 comment
Open

rename /etc/bash_completion.d/glow #664

iconoclasthero opened this issue Dec 20, 2024 · 1 comment

Comments

@iconoclasthero
Copy link

iconoclasthero commented Dec 20, 2024

Describe the bug
glow is also named glow and when you . from the former's directory it errors out because it actually sources the latter.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS rhino/ubuntu
  • Shell bash 5.2.37
  • Terminal Emulator guake [e.g. kitty, iterm]
  • Terminal Multiplexer n/a [e.g. tmux]
  • Locale [e.g. en_US.UTF-8,

To Reproduce
Steps to reproduce the behavior:

$ . /etc/bash_completion.d/glow; cd /etc/bash_completion.d/; pwd; . glow; hr; which glow; type glow
/etc/bash_completion.d
-bash: .: /usr/bin/glow: cannot execute binary file
###################################################################################
/usr/bin/glow
/bin/glow
glow is /usr/bin/glow

Expected behavior
A clear and concise description of what you expected to happen.

i just want to be able to source /etc/bash_completion.d/glow from it's directory without error.

solution

rename /etc/bash_completion.d/glow to /etc/bash_completion.d/glow-completion.bash

What's going on here?

I know little about bash completion, but what I've pieced together is that when I tried to source everything in /etc/bash_completion.d I had an issue with /etc/bash_completion.d/glow because it has the same name as the pathed /usr/bin/glow. Again, without a comprehensive background in bash completions scripts, it is a bit hard for me to definitely say that the "correct" way to name completions script is <parent script name>-completion.bash, but it is not a poor paradigm to adopt which is why I save my completion scripts with that naming pattern.

So, the requested PR is to change the completion script from glow to glow-completion.bash or, since I assume this is designed to also work on shells other than bash, glow-completion or glow-completion.shell or glow-completion.<shell-specific extension> would also be cromulent alternatives.

@iconoclasthero
Copy link
Author

iconoclasthero commented Dec 20, 2024

Also, it would be nice if $ glow <tab> would pull the README.md file. I thought that was what the PR that I was looking at (#512) was supposed to do but glow does not do that since

completion  (Generate the autocompletion script for the specified shell)
config      (Edit the glow config file)
help        (Help about any command)

instead of $ glow <tab> --> $ glow README.md which is really all that glow's completion needs to do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant