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
[libvirt] Bash syntax error #147
Comments
Sorry for the late reply. I'm sorry but now am extremely busy. I hope I can respond in detail this weekend. At the moment, the problem is not observed in my environment.
|
Don't worry, I have plenty of time ^_^ Besides, I'm only experiencing the issue when I try to autocomplete
I have tested it out on the default |
I confirmed it in fc35. This is a bug of the bash-completion script for virsh (libvirt-client), DescriptionThe script overwrites the # Start a session without ble.sh
$ declare -p IFS | cat -A
declare -- IFS=" ^I$
"$
$ virsh a[TAB][TAB]
allocpages attach-device attach-disk attach-interface autostart
$ virsh a[C-c]
$ declare -p IFS | cat -A
declare -- IFS="$
"$ Originally the value of IFS is $ a='a b c'
$ printf '<%s>\n' $a
<a>
<b>
<c>
$ virsh a[TAB][TAB][C-c]
$ printf '<%s>\n' $a
<a b c> The shell variable FixThe completion function diff --git a/tools/bash-completion/vsh.in b/tools/bash-completion/vsh.in
index 70ade50a02..4399ff0a64 100644
--- a/tools/bash-completion/vsh.in
+++ b/tools/bash-completion/vsh.in
@@ -4,7 +4,7 @@
_@command@_complete()
{
- local words cword c=0 i=0 cur RO URI CMDLINE INPUT A
+ local words cword c=0 i=0 cur word RO URI CMDLINE INPUT A
# Here, $COMP_WORDS is an array of words on the bash
# command line that user wants to complete. However, when
@@ -56,7 +56,8 @@ _@command@_complete()
# the name of the command whose arguments are being
# completed.
# Therefore, we might just run $1.
- IFS=$'\n' A=($($1 ${CMDLINE[@]} complete -- "${INPUT[@]}" 2>/dev/null))
+ local IFS=$'\n'
+ A=($($1 ${CMDLINE[@]} complete -- "${INPUT[@]}" 2>/dev/null))
COMPREPLY=($(compgen -W "${A[*]%--}" -- ${cur}))
__ltrim_colon_completions "$cur"
--
2.21.3 ReferenceReport
I think I'll later add a workaround for this completion script at the |
Ah, so it's as I suspected. If you already have sent a patch to the maintainers, then I won't submit a bug report. Thank you for your help ^_^ |
The patch has been accepted in the upstream: I think it would take some time for the patch to be applied to the distributed versions, so I added a workaround for this problem to Thank you for reporting the issue! |
ble version: 0.4.0-devel3+2243e91
Bash version: 5.1.8(1)-release (x86_64-redhat-linux-gnu)
I'm experiencing a weird bug when I try to autocomplete the
virsh
command (so far, this is the only one I've found this happens with): basically,bash
tells me there's a syntax error, as you can see from the screenshot below.I am 100% sure that it's an issue with ble, since commenting out (i.e. disabling) the
source
at the end of my.bashrc
does not reproduce the error.Thanks~
The text was updated successfully, but these errors were encountered: