neoclide/coc.nvim · error
Unable to open input window
Error message
Unable to open input window
What it means
InputUI.show() calls the Vim script function coc#dialog#create_prompt_win to create the floating input window. The error is thrown when the Vim side returns a falsy result, meaning the floating/popup window could not be created (e.g. no floating window support or the vim function failed). coc.nvim throws this so callers of request()/createInputBox know no input UI exists.
Source
Thrown at src/model/input.ts:157
}
public get bufnr(): number | undefined {
return this._bufnr
}
public get winid(): number | undefined {
return this._winid
}
public async show(title: string, preferences: InputPreference): Promise<boolean> {
this.title = title
this.borderhighlight = preferences.borderhighlight ?? 'CocFloatBorder'
this.loading = false
if (preferences.placeHolder && !this._input && !isVim) {
this.clear = true
}
let res = await this.nvim.call('coc#dialog#create_prompt_win', [title, this._input, omitUndefined(preferences)]) as RequestResult
if (!res) throw new Error('Unable to open input window')
this._bufnr = res[0]
this._winid = res[1]
this._dimension = res[2]
return true
}
public dispose(): void {
if (this._disposed) return
this._disposed = true
this.nvim.call('coc#float#close', [this._winid ?? -1], true)
if (isVim) this.nvim.command(`silent! bd! ${this._bufnr}`, true)
this._onDidFinish.fire(this.accepted ? this._input : null)
this._winid = undefined
this._bufnr = undefined
disposeAll(this.disposables)
}
}
View on GitHub (pinned to 50e974d969)
Solutions
- Upgrade to Vim 8.2+/Neovim 0.4+ compiled with floating window support (check :echo has('float') or has('popupwin'))
- Ensure coc.nvim has an attached UI (open a real editor buffer, not --headless) before calling requestInput
- Wrap the show()/requestInput() call in try/catch and fall back to input() or another prompt mechanism
- Check :CocInfo and terminal capabilities; try a different terminal emulator
Example fix
// before
const val = await workspace.requestInput('Name:')
// after
let val: string | undefined
try {
val = await workspace.requestInput('Name:')
} catch (e) {
// floating window unavailable, fall back
window.showErrorMessage('Input dialog not supported in this environment')
} Defensive patterns
Strategy: try-catch
Validate before calling
// Vim-side check before invoking the API
// :echo has('float') || has('popupwin') -> must be 1 Try / catch
try {
const val = await workspace.requestInput('Name:')
} catch (e) {
if (e.message.includes('Unable to open input window')) {
// fallback: notify user or use a non-float prompt
}
} Prevention
- Require Vim 8.2+/Neovim with floating window support
- Only prompt after the coc UI is attached (workspaceReady)
- Provide a fallback prompt path for limited terminals
When it happens
Trigger: Calling await inputBox.show() or await workspace.requestInput() in an environment where coc#dialog#create_prompt_win returns null/0 — typically Vim without +float/+popup support, a terminal without GUI floating support, or an aborted dialog (user/environment cancels creation).
Common situations: Running plain Vim older than 8.2 or a terminal emulator that cannot render floating windows; calling requestInput during startup before the UI is attached (headless/coc-nvim-less buffer); running inside a tmux/screen setup where floats fail.
Related errors
- Unable to open list window.
- required capabilities do not exist.
- coc.nvim requires Node.js VM modules support for ESM extensi
- watchman not found
AI-assisted analysis of neoclide/coc.nvim@50e974d969 (2026-08-31).
Data as JSON: /api/errors/7775d0b0231056ac.
Report an issue: GitHub.