neoclide/coc.nvim · error
Unable to open list window.
Error message
Unable to open list window.
What it means
QuickPick.show() first opens an input window, then calls coc#dialog#create_list to create the floating list window. When that Vim function returns a falsy result the list window was not created, so coc.nvim throws this error instead of returning a QuickPick with no window.
Source
Thrown at src/model/quickpick.ts:200
let rounded = !!preferences.rounded
await input.show(this.title, {
quickpick: lines,
position: 'center',
placeHolder: this.placeholder,
marginTop: 10,
border: [1, 1, 0, 1],
list: true,
rounded,
minWidth,
maxWidth: this.maxWidth,
highlight: preferences.floatHighlight,
borderhighlight: preferences.floatBorderHighlight
})
let opts: any = { lines, rounded, maxHeight, highlights, linecount: Math.max(1, lincount) }
if (preferences.floatHighlight !== undefined) opts.highlight = preferences.floatHighlight
if (preferences.floatBorderHighlight !== undefined) opts.borderhighlight = preferences.floatBorderHighlight
let res = await nvim.call('coc#dialog#create_list', [input.winid, input.dimension, opts])
if (!res) throw new Error('Unable to open list window.')
// let height
this.win = new Popup(nvim, res[0], res[1], lines.length)
this.win.refreshScrollbar()
this.bufnr = res[1]
this.setCursor(0)
this.attachEvents(input.bufnr)
}
private buildList(items: ReadonlyArray<T>, input: string, loose = false): { lines: string[], highlights: HighlightItem[] } {
let { selectedItems, canSelectMany } = this
let filteredItems: T[] = []
let filtered: FilteredLine[] = []
let emptyInput = input.length === 0
let lowInput = input.toLowerCase()
const scoreFn: FuzzyScorer = loose ? anyScore : fuzzyScoreGracefulAggressive
const wordPos = canSelectMany ? 4 : 0
for (let index = 0; index < items.length; index++) {
const item = items[index]View on GitHub (pinned to 50e974d969)
Solutions
- Verify Vim 8.2+/Neovim floating window support (:echo has('float') && has('popupwin'))
- Ensure show() is called when the editor UI is attached and the buffer is visible
- Wrap show() in try/catch and handle the failure (fallback to a plain list via window.showPickOption style API)
- Check for autocmnds/plugins that close floating windows immediately after creation
Example fix
// before
await quickPick.show()
// after
try {
await quickPick.show()
} catch (e) {
window.showErrorMessage('QuickPick window could not be opened')
} Defensive patterns
Strategy: try-catch
Validate before calling
if (!workspace.isReady) return
// Vim: :echo has('float') && has('popupwin') Try / catch
try {
await quickPick.show()
} catch (e) {
if (e.message.includes('Unable to open list window')) {
window.showErrorMessage('QuickPick unavailable in this environment')
}
} Prevention
- Check floating window support before using QuickPick
- Avoid closing/disposing the underlying input window while show() runs
- Test in your target terminals (tmux, screen) before shipping
When it happens
Trigger: Calling await quickPick.show() when coc#dialog#create_list returns null/0 — floating window creation fails (no float/popup support), invalid dimension from the input window, or the input window itself was closed/invalid before list creation.
Common situations: Using QuickPick API in Vim lacking +popupwin, screen too small with maxHeight constraints, or calling show() after the quickpick was disposed/window closed by an autocmd racing the creation.
Related errors
AI-assisted analysis of neoclide/coc.nvim@50e974d969 (2026-08-31).
Data as JSON: /api/errors/dae4dc39ee7c2019.
Report an issue: GitHub.