{"record":{"id":"7775d0b0231056ac","repo":"neoclide/coc.nvim","slug":"unable-to-open-input-window","errorCode":null,"errorMessage":"Unable to open input window","messagePattern":"Unable to open input window","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/model/input.ts","lineNumber":157,"sourceCode":"  }\n\n  public get bufnr(): number | undefined {\n    return this._bufnr\n  }\n\n  public get winid(): number | undefined {\n    return this._winid\n  }\n\n  public async show(title: string, preferences: InputPreference): Promise<boolean> {\n    this.title = title\n    this.borderhighlight = preferences.borderhighlight ?? 'CocFloatBorder'\n    this.loading = false\n    if (preferences.placeHolder && !this._input && !isVim) {\n      this.clear = true\n    }\n    let res = await this.nvim.call('coc#dialog#create_prompt_win', [title, this._input, omitUndefined(preferences)]) as RequestResult\n    if (!res) throw new Error('Unable to open input window')\n    this._bufnr = res[0]\n    this._winid = res[1]\n    this._dimension = res[2]\n    return true\n  }\n\n  public dispose(): void {\n    if (this._disposed) return\n    this._disposed = true\n    this.nvim.call('coc#float#close', [this._winid ?? -1], true)\n    if (isVim) this.nvim.command(`silent! bd! ${this._bufnr}`, true)\n    this._onDidFinish.fire(this.accepted ? this._input : null)\n    this._winid = undefined\n    this._bufnr = undefined\n    disposeAll(this.disposables)\n  }\n}\n","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/neoclide/coc.nvim/blob/50e974d9692461a69147d5cab146a8d3e439abe4/src/model/input.ts#L139-L175","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nconst val = await workspace.requestInput('Name:')\n// after\nlet val: string | undefined\ntry {\n  val = await workspace.requestInput('Name:')\n} catch (e) {\n  // floating window unavailable, fall back\n  window.showErrorMessage('Input dialog not supported in this environment')\n}","handlingStrategy":"try-catch","validationCode":"// Vim-side check before invoking the API\n// :echo has('float') || has('popupwin')  -> must be 1","typeGuard":null,"tryCatchPattern":"try {\n  const val = await workspace.requestInput('Name:')\n} catch (e) {\n  if (e.message.includes('Unable to open input window')) {\n    // fallback: notify user or use a non-float prompt\n  }\n}","preventionTips":["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"],"tags":["vim","floating-window","ui","environment"],"backgroundTag":"floating-window-unsupported","analyzedSha":"50e974d9692461a69147d5cab146a8d3e439abe4","analyzedAt":"2026-08-31T11:17:23.966Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}