{"record":{"id":"acdd862974e0239e","repo":"sqlmapproject/sqlmap","slug":"missing-curses-module-optional-python-module","errorCode":null,"errorMessage":"missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)","messagePattern":"missing 'curses' module \\(optional Python module\\)\\. Use a Python build that includes curses/ncurses, or install the platform-provided equivalent \\(e\\.g\\. for Windows: pip install windows-curses\\)","errorType":"exception","errorClass":"SqlmapMissingDependence","httpStatus":null,"severity":"error","filePath":"lib/utils/tui.py","lineNumber":914,"sourceCode":"                        self.scroll_offset = self.current_field - visible_lines + 1\n            elif key == curses.KEY_ENTER or key == 10 or key == 13:  # Enter\n                self._edit_field()\n            elif key == curses.KEY_F2:  # F2 to run\n                self._run_sqlmap()\n            elif key == curses.KEY_F3:  # F3 to export\n                self._export_config()\n            elif key == curses.KEY_F4:  # F4 to import\n                self._import_config()\n            elif key == ord(' '):  # Space for boolean toggle\n                option = tab['options'][self.current_field]\n                if option['type'] == 'bool':\n                    option['value'] = not option['value']\n\ndef runTui(parser):\n    \"\"\"Main entry point for ncurses TUI\"\"\"\n    # Check if ncurses is available\n    if curses is None:\n        raise SqlmapMissingDependence(\"missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)\")\n    # ncurses waits ESCDELAY ms (default 1000) after Esc to disambiguate escape sequences, which\n    # makes Esc feel like it hangs for ~1s; shrink it so Esc reacts immediately\n    os.environ.setdefault(\"ESCDELAY\", \"25\")\n    try:\n        # Initialize and run\n        def main(stdscr):\n            if hasattr(curses, \"set_escdelay\"):\n                try:\n                    curses.set_escdelay(25)\n                except curses.error:\n                    pass\n            ui = NcursesUI(stdscr, parser)\n            ui.run()\n\n        curses.wrapper(main)\n\n    except Exception as ex:\n        errMsg = \"unable to create ncurses UI ('%s')\" % getSafeExString(ex)","sourceCodeStart":896,"sourceCodeEnd":932,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/utils/tui.py#L896-L932","documentation":"Error \"missing 'curses' module (optional Python module). Use a Python build that includes curses/ncurses, or install the platform-provided equivalent (e.g. for Windows: pip install windows-curses)\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/utils/tui.py:914 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}