terminal

package
v0.0.0-...-d80aada Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package terminal provides enhanced terminal input handling

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearScreen

func ClearScreen()

ClearScreen clears the terminal screen

Types

type InputReader

type InputReader struct {
	// contains filtered or unexported fields
}

InputReader provides enhanced terminal input with history and line editing

func NewInputReader

func NewInputReader(prompt string) (*InputReader, error)

NewInputReader creates a new terminal input reader with the specified prompt

func (*InputReader) Close

func (r *InputReader) Close() error

Close cleans up the readline instance

func (*InputReader) IsTerminal

func (r *InputReader) IsTerminal() bool

IsTerminal returns true if input is from a terminal

func (*InputReader) ReadLine

func (r *InputReader) ReadLine() (string, error)

ReadLine reads a line from the terminal with full line editing support

func (*InputReader) ReadMultiLine

func (r *InputReader) ReadMultiLine() (string, error)

ReadMultiLine reads multiple lines until the user enters an empty line This is useful for entering longer messages or code snippets

func (*InputReader) SetPrompt

func (r *InputReader) SetPrompt(prompt string)

SetPrompt updates the prompt string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL