autocomplete : fix newlines.

This commit is contained in:
Dmitry Voronin 2023-11-27 16:28:27 +03:00
parent 520b01993c
commit 843a41a708
2 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@
_autocomplete()
{
local IFS=$'\n'
local commands="${@}"
local commands="${*}"
COMPREPLY=()
@ -20,8 +20,8 @@ _autocomplete()
_autocomplete_first()
{
local IFS=$'\n'
local commands="${@}"
local commands="${*}"
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"

View file

@ -77,9 +77,9 @@ _complete_tmux_sessions()
_complete_tmux_name()
{
_autocomplete_first "${PWD##*/}" $(ls --classify | grep /$ | sed -e 's/\/$//')
_autocomplete_first "${PWD##*/}"$'\n'$(ls --classify | grep /$ | sed -e 's/\/$//')
}
complete -F _complete_tmux_session ta
complete -F _complete_tmux_sessions tk
complete -o nosort -F _complete_tmux_name tr tn
complete -o nosort -F _complete_tmux_name trn tn