Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dynamic_curses_input

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamic_curses_input

  • 1.2.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DynamicCursesInput

DynamicCursesInput is a Ruby gem that provides a simple and intuitive way to handle user input in a Curses-based terminal user interface (TUI). It allows for dynamic input handling, including cursor movement and inline character addition and deletion.

Table of Contents

  • Installation
  • Usage
  • Documentation
  • Dependencies
  • FAQs
  • Troubleshooting
  • Contribution Guidelines
  • License

Installation

To install DynamicCursesInput, add the following line to your application's Gemfile:

gem 'dynamic_curses_input'

Then execute:

$ bundle install

Or install it yourself as:

$ gem install dynamic_curses_input

Usage

Here's a simple example of how to use DynamicCursesInput:

require "curses"
require "dynamic_curses_input"

begin
  Curses.init_screen
  Curses.start_color
  Curses.addstr("You should be able to use the left and right arrow keys to switch between characters in the line, and selectively edit them.\n")
  Curses.addstr("Enter your name: ")
  name = DCI.catch_input(true)
  Curses.addstr("\nYou entered: #{name}")
  Curses.getch

  # Log the output
  logger.info("Name entered: #{name}")
ensure
  Curses.close_screen
end

In this example, DCI.catch_input(true) will capture user input until the Enter key is pressed, echoing the input to the screen.

Documentation

Detailed documentation for each function is available in the wiki.

Dependencies

DynamicCursesInput depends on the Curses gem.

FAQs

  • Q: How do I handle special keys like arrow keys?
    • A: Special keys like arrow keys are automatically handled by DynamicCursesInput.

Troubleshooting

If you encounter any issues while using DynamicCursesInput, please check the issues page. If your issue isn't listed, feel free to open a new issue.

Contribution Guidelines

We welcome contributions from the community! Please read our contribution guidelines before submitting a pull request.

License

DynamicCursesInput is available under the MIT License.


Note from the Developer:

There is a function in this gem that is not finished yet, it's for making asking questions in a Curses TUI easier from within the gem. This method shouldn't be used yet.

FAQs

Package last updated on 20 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc