An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

proxy.golang.org : github.com/nao1215/prompt : v0.0.4

Package prompt provides a modern, robust terminal prompt library for Go. This library is designed as a replacement for the unmaintained go-prompt library, addressing critical issues like divide-by-zero panics, memory leaks, and limited cross-platform support while providing enhanced functionality. Key Features: Quick Start: The simplest way to create a prompt: Advanced Usage with Completion: Key Bindings: The library supports comprehensive key bindings out of the box: Custom Key Bindings: You can customize key bindings by creating a custom KeyMap: Context Support: Use RunWithContext for timeout or cancellation support: Error Handling: The library provides specific error types for different scenarios: Multi-line Input: The prompt automatically detects and handles multi-line input. When the buffer contains newline characters, arrow keys navigate between lines instead of history, and Home/End keys move to line boundaries instead of buffer boundaries. Thread Safety: Prompt instances are not thread-safe. Each prompt should be used from a single goroutine. However, you can safely cancel a prompt from another goroutine using context cancellation. Resource Management: Always call Close() when done with a prompt to prevent resource leaks: The Close method is safe to call multiple times and should be called even if Run or RunWithContext returns an error. Package prompt provides a library for building powerful interactive terminal prompts. This is a modern replacement for go-prompt with better cross-platform support, simpler API, and built-in color scheme support.

Registry - Documentation - Download - JSON - codemeta.json
purl: pkg:golang/github.com/nao1215/prompt@v0.0.4
Published:
Indexed:
Related tag: v0.0.4

    Loading...
    Readme
    Loading...