[vim/vim] wildtrigger() might leave opened popupmenu (Issue #18298)

8 views
Skip to first unread message

Maxim Kim

unread,
Sep 14, 2025, 7:43:20 PM (2 days ago) Sep 14
to vim/vim, Subscribed
habamax created an issue (vim/vim#18298)

Steps to reproduce

  1. vim --clean
  2. source following
vim9script

set wildmode=noselect:lastused,full
set wildmenu wildoptions=pum,fuzzy pumheight=12
augroup CmdComplete
    au!
    autocmd CmdlineChanged : {
        if getcmdcompltype() != 'shellcmd'
            wildtrigger()
        endif
    }
augroup END
  1. type :term hello

Expected behaviour

Popup menu should not show terminal

image.png (view on web)

https://asciinema.org/a/hYyC3H4iC3I69CkQP9GDrfO4C

The usecase, I don't want to autocomplete with shellcmd in Windows or WSL as it is very slow there: :! or :term might stuck for up to 15 seconds on my machine.

    autocmd CmdlineChanged : {
        # :! and :term completion is very slow on Windows and WSL, disable it there.
        if !((has("win32") || exists("$WSLENV")) && getcmdcompltype() == 'shellcmd')
            wildtrigger()
        endif
    }

@girishji fyi

Version of Vim

9.1.1754

Environment

debian12,bash

Logs and stack traces


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298@github.com>

Maxim Kim

unread,
Sep 14, 2025, 7:51:00 PM (2 days ago) Sep 14
to vim/vim, Subscribed
habamax left a comment (vim/vim#18298)

It doesn't help if I try to use command name comparisson:

image.png (view on web)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3290050106@github.com>

Maxim Kim

unread,
Sep 14, 2025, 7:55:22 PM (2 days ago) Sep 14
to vim/vim, Subscribed
habamax left a comment (vim/vim#18298)

To be honest, I wouldn't say this is a bug, but something that might need an improvement.

Either on shellcmd completion speed or figure out the way to tell wildtrigger what cmd completion types it should complete.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3290054806@github.com>

girish

unread,
Sep 15, 2025, 6:21:33 AM (yesterday) Sep 15
to vim/vim, Subscribed
girishji left a comment (vim/vim#18298)

Bug: The popup with terminal should not remain after typing a space.

Why is your comparison logic not working when you type term hello?

It is possible to run selected OS tasks in the background and abort them if a timeout is exceeded, to avoid delaying autocompletion. However, this adds more complexity.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3291446588@github.com>

Maxim Kim

unread,
Sep 15, 2025, 6:32:00 AM (yesterday) Sep 15
to vim/vim, Subscribed
habamax left a comment (vim/vim#18298)

Why is your comparison logic not working when you type term hello?

Because after hello cmd completion type is file, not sure why though.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3291486790@github.com>

girish

unread,
Sep 15, 2025, 6:52:49 AM (yesterday) Sep 15
to vim/vim, Subscribed
girishji left a comment (vim/vim#18298)

Why is your comparison logic not working when you type term hello?

Because after hello cmd completion type is file, not sure why though.

It is the default I think. You don't have to check for cmdtype.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3291557181@github.com>

Maxim Kim

unread,
Sep 15, 2025, 6:57:19 AM (yesterday) Sep 15
to vim/vim, Subscribed
habamax left a comment (vim/vim#18298)

It is the default I think. You don't have to check for cmdtype.

I only check for getcmdcompltype() vs 'shellcmd':

...
        # :! and :term completion is very slow on Windows and WSL, disable it there.
        if !((has("win32") || exists("$WSLENV")) && getcmdcompltype() == 'shellcmd')
            wildtrigger()
        endif
...


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3291575187@github.com>

girish

unread,
Sep 15, 2025, 7:20:12 AM (yesterday) Sep 15
to vim/vim, Subscribed
girishji left a comment (vim/vim#18298)

I think using string comparison or regex for filtering is more robust.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3291655235@github.com>

Maxim Kim

unread,
Sep 15, 2025, 7:26:07 AM (yesterday) Sep 15
to vim/vim, Subscribed
habamax left a comment (vim/vim#18298)

I think using string comparison or regex for filtering is more robust.

I tried it and it doesn't matter, there is always hanging menu left visible.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3291676367@github.com>

Maxim Kim

unread,
Sep 15, 2025, 7:37:43 AM (yesterday) Sep 15
to vim/vim, Subscribed
habamax left a comment (vim/vim#18298)

I think using string comparison or regex for filtering is more robust.

vim9script
set wildmode=noselect:lastused,full
set wildmenu wildoptions=pum,fuzzy pumheight=12

augroup CmdComplete
    au!
    autocmd CmdlineChanged : {
        if !(getcmdline() =~ '^terminal')
            wildtrigger()
        endif
    }
augroup END

https://asciinema.org/a/G7kGHbl1BQbJMCnzk2N2FQIgO


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3291719331@github.com>

girish

unread,
Sep 15, 2025, 9:18:11 AM (yesterday) Sep 15
to vim/vim, Subscribed
girishji left a comment (vim/vim#18298)

I think using string comparison or regex for filtering is more robust.

I tried it and it doesn't matter, there is always hanging menu left visible.

Yes, that’s a bug outside the scope of Vimscript.
You've already solved the ":term might stuck for up to 15 seconds " problem, correct?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3292118022@github.com>

Maxim Kim

unread,
Sep 15, 2025, 7:37:55 PM (yesterday) Sep 15
to vim/vim, Subscribed
habamax left a comment (vim/vim#18298)

You've already solved the ":term might stuck for up to 15 seconds " problem, correct?

Yes, by not calling wildtrigger() for :terminal. So this issue is about popupmenu leftover.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/18298/3294333534@github.com>

Reply all
Reply to author
Forward
0 new messages