Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: menu-select doesn't respect COMPLETE_IN_WORD option
- X-seq: zsh-users 24932
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Alan <8fvebtoeq87@xxxxxxxxx>
- Subject: Re: menu-select doesn't respect COMPLETE_IN_WORD option
- Date: Sun, 14 Jun 2020 17:37:30 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAL7A0-Mye7pcAVdhFT0tcc3XAoHOokY7qAQqo-tgN=bs1cNPOw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAL7A0-P6qmPidGHiYy6=1jmUY6T=X4xktbp1Wv2CBO0CX2xJRQ@mail.gmail.com> <CAH+w=7Z8F5-9g2isMha2B0gUU-fVYirezaEWr1AnupQRep6A6A@mail.gmail.com> <CAL7A0-NSfM7fRZS4491teaUJGBkQW46RC+JtwS7PtHM4RX1mPg@mail.gmail.com> <CAL7A0-POtHWPReN0Z3z+Z7x7+1=aa+WfXvozKex=-mzJr0mQJQ@mail.gmail.com> <CAH+w=7aR_BjcWsfRZOtSas+r9zHphf12-2f=-C0CYZHZ4b3gCg@mail.gmail.com> <CAL7A0-PMSV6ZM5USa55mfH4=xaV0heCL7Uqe31B8RJxcgTBWjg@mail.gmail.com> <CAH+w=7Y1gnTGA0hWf7o5ffTdor17EQE1PTGe_YrqkxvWGk72rQ@mail.gmail.com> <CAL7A0-Mye7pcAVdhFT0tcc3XAoHOokY7qAQqo-tgN=bs1cNPOw@mail.gmail.com>
On Sat, Jun 13, 2020 at 9:28 PM Alan <8fvebtoeq87@xxxxxxxxx> wrote:
>
> When I leave completeinword unset, _prefix completion simply doesn't work, even if I have:
>
> zstyle ':completion:*' completer _expand _prefix _complete _ignored _prefix
>
> One additional thing I've found to be really strange about _prefix completion is if there is only one possible match. For example:
>
> % ls -a
> ./ ../
> % mkdir -p dir1/dir2/dir3
> % ls dir1/di_r2/dir3<menu-complete> (<-- where _ is the position of the cursor)
> % ls dir1_ (<-- the "/dir2/dir3" part of the line has been removed!)
Starting from "zsh -f" and like you using "_" for cursor position:
% compinit -D
% zstyle \* format %d
% zstyle ':completion:*' menu 'select=1'
% zstyle ':completion:*' completer _expand _prefix _complete _ignored
% mkdir -p dir1/dir2/dir3
% ls dir1/di_r2/dir3
% ls dir1/dir2/dir3/_
The above happens with any of complete-word, expand-or-complete, or
menu-complete.
If I run expand-or-complete-prefix instead:
% ls dir1/di_r2/dir3
% ls dir1/dir2/_r2/dir3
Which looks exactly like I would expect.
% set -o | grep complete
completealiases off
completeinword off
globcomplete off
menucomplete off
If I turn on "globcomplete" then nothing works except
expand-or-complete-prefix, but I still don't get anything removed from
the line. I just get a beep and the cursor stays in the middle of
"dir2" and the description "files" appears (from the format zstyle).
If I turn on "completeinword" then I can reproduce your described
behavior with menu-complete, although expand-or-complete-prefix still
works as expected. Looking at the output of ^x? (complete-debug),
what's happening is that _prefix says "if there is only one possible
completion, then insert only the unambiguous prefix" which (because of
the way completing across a directory boundary works) is only "dir1".
This does not occur if you are completing a file name in the current
directory:
% touch part1.part2.part3
% ls part1.pa_rt2.part3
% ls part1.part2.part3_rt2.part3
So I still think you want to leave complete-in-word turned off and
find out what other part of your startup is breaking things when you
do.
Incidentally the _prefix behavior with the unambiguous prefix is
itself a compromise; before workers/18841 (2003-07-09) it would
alarmingly delete the entire word from the line.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author