-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Completion of commands prefixed with sudo
#480
Comments
The handling of the command part
$ ble/widget/display-shell-version
$ complete -p sudo
$ complete -p my_command
|
Sorry I took some time on this. I saw some behaviour I wanted to isolate from my settings, by spinning up a VM....
With fzf
Without fzf
I completely removed my .bashrc and got
So I guessed this is a problem with my distro... To be sure, I tested with a clean install, in a VM with no blesh, and I saw the same. And if I do: Another interesting behaviour I noticed - completions for sudo change after I try it. eg:
It does this in stock bash with no blesh as well as with blesh. I'm unsure if this is relevant or normal? Hope this is helpful. |
This is an interesting behavior. I'm confused about whether this behavior is observed with or without blesh (since you mention that something is the same even without blesh). Does this happen both with and without blesh?
Ah, yes. This is an intended behavior. Your result of I'm not sure if it is the same as the reported one, but I noticed that the ble.sh's This is a somewhat expected behavior because the generation of the option descriptions is independent of the generation of the options. Since the plain Bash doesn't offer a way to show the descriptions, the However, this may contaminate the |
Sorry, I knew that my wording was bad! English is not a good language for describing a state machine... And maybe I'm just not good at English 🤣 Without blesh, I see completions for cp with both examples. So: I think this might be a more precise definition of the original issue I was reporting. I mentioned that it happens "sometimes", but I could not quite make a pattern of it, but I do this a lot, this "type in the command - oh wait, I need sudo for this - edit the line to add sudo to the beginning", and I suspect that this behaviour of mine is the "sometimes".
OK that's cool, it seemed intentional, but I thought it might be relevant. I don't have any problem with this. |
@pallaswept In commit cbcce62, I fixed the above issue. Although this problem seems different from the problem that you reported, I think it might be correlated. Could you check the behavior with the latest |
ble version: 0.4.0-nightly+a9b962d
Bash version: 5.2.26(1)-release (x86_64-suse-linux)
This is a very minor thing, but I keep bumping into it, so I thought I should mention it.
I have noticed that sometimes, if I am typing a command (let's call it
my_command
) which needs to be run as root, I start typingsudo my_command <tab>
and the completions do not seem right formy_command
, instead, I get the completions forsudo
.This is often not "wrong" or a "bug" because the sudo options could be used, but I thought that perhaps, the syntax-aware part of ble.sh might consider something like, it will show completion for 'sudo', only if another command has not been entered afterward?
Thanks!
The text was updated successfully, but these errors were encountered: