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
variables not expanded after xargs #173
Comments
|
As of 2019 why does this |
|
|
This would fix it diff --git a/bash_completion b/bash_completion
index 1d2d2d0b..b8957333 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1820,4 +1823,5 @@ _command_offset()
if [[ $COMP_CWORD -eq 0 ]]; then
+ _variables && return
local IFS=$'\n'
compopt -o filenamesThere are more places than this where we complete with command names, but we don't complete variable names in any of them based on a quick look. Not entirely sure why. On the other hand a correct completion would depend on exactly what the variable is pointing to; e.g. it should behave differently if it expands to a dir (no space added) or a command (space added) and not even complete variable names that don't expand to either. |
|
Well all I know is the user has already typed in a "$" and a few more letters, before hitting TAB. |
|
Didn't mean that, but rather variables like $HOME, $TMPDIR, etc. |
|
All I know is that if I do |
|
I'm fairly certain that there is also an expectation whether the completion should add a space after completing the variable or not. But meh, as said, completing the variable in this particular case could be an improvement in the first place, space or not. |
|
Yup, needs a space after it too. |
|
...except when you're completing let's say $HOME or $TMPDIR, or anything that is a directory, then the space is incorrect. |
|
Hmm, OK. Perhaps detect slashes. And if it is a URL then just like directories, as the user probably wants to put something on the end too...(?) |
|
URL completion is out of scope for completion of command names, no URL will complete to a valid one. But as you see, there's more to it than it looks on the surface. |
|
In this bug I am only talking about expanding the names of variables,
not their values.
OK let's just always put a space after all of them.
No more need to make judgments about which names they use or what their
values are.
|
The text was updated successfully, but these errors were encountered: