-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Question about relation to other completion frameworks #938
Comments
It depends. I myself switched to elvish, so I use it for all my completions.
|
It also adds some completion to for example ssh or dig.
yeah, it does. |
It would need a different output then. Leaving out the descriptions is certainly possible, just not very useful. |
It's just undocumented, but it is possible to generate descriptions with candidates for _comp_cmd_test1() {
if [[ ${BLE_ATTACHED-} ]]; then
# If ble.sh is in the attached state.
# Change the menu style to "desc" for the current completion
bleopt complete_menu_style=desc
# Generate filename or directory name (The description is automatically
# generated from the filename for "file").
ble/complete/cand/yield file 'file.txt'
# Generate words with description.
ble/complete/cand/yield word 'my-word' 'This is a description for my-word.'
# Generate option with OPTARG indicated in the list. In the third argument
# $'OPTION\x1cOPTARG\x1cSUFFIX\x1cDESCROPTION', FS ($'\x1c') is used to
# separate OPTION, OPTARG indicator, SUFFIX that is inserted after inserted
# the unique completion, and DESCRIPTION
ble/complete/cand/yield mandb '--option' $'--option\x1c=<something>\x1c=\x1cThis is a description for the option'
else
# If ble.sh is not loaded or is in the detached state, just generate
# candidates for the default progcomp system of Bash.
COMPREPLY+=(file.txt)
COMPREPLY+=(my-word)
COMPREPLY+=(--option)
fi
}
complete -F _comp_cmd_test1 test1 Some additional adjustments might be needed for the detailed behavior.
|
Added experimental support. There are likely some issues, but basics seem to work alright.
bleopt complete_auto_complete=
source <(carapace _carapace bash-ble) |
Great! I am going to test that for some completions in the next days. So far I always detected ble.sh with the |
Yes. You can detect whether the current completions are automatically invoked one or not by the following test: [[ :$comp_type: == *:auto:* ]] If the completion function returns without generating any candidates, the default completion by
If the bottleneck is the for cand in "${c[@]}"; do
+ ((cand_iloop++%bleopt_complete_polling_cycle==0)) && ble/complete/check-cancel && return 148
[ ! -z "$cand" ] && ble/complete/cand/yield mandb "${cand%%$'\t'*}" "${cand##*$'\t'}"
done
There is no plan of exporting
Anyway, if the determination of the completion type would be determined at the initialization stage, we should use It should be noted that, if the type of completion is statically determined at the initialization time, the completion will not work when ble.sh is in the detached state (though So far I couldn't take time to see how to use |
Ah, i expected |
Ah, OK, if so. maybe you can call the command using ble/util/conditional-sync \
"carapace chmod bash-ble \"\${words[@]}\"" \
'! ble/complete/check-cancel <&$_ble_util_fd_stdin' 128 progressive-weight edit (2022-05-13): fixed a code for the redirection of stdin.
|
I am bit confused how the relation of carapace-bin is to other completion frameworks like bash-completion, fzf or bleh.sh. Is it supposed to be an addition to them or does it replace them complete? So far I saw no compatibility issues with bash-completion or fzf since it overwrites their handling but ble.sh breaks at least chmod and the result is
chmod '0 (none)' carapace-bin_0.9.1_Linux_x86_64.tar.gz
.The text was updated successfully, but these errors were encountered: