repl

package
v2026.610.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInputInterrupted = errors.New("repl: input interrupted")

Functions

func AutosuggestDisabled added in v2026.606.0

func AutosuggestDisabled() bool

func CommonRunePrefixForTest added in v2026.602.4

func CommonRunePrefixForTest(candidates [][]rune) []rune

func NewReadline

func NewReadline(defaultPrompt string) (*readline.Instance, func(string) (string, error), error)

func PrintWelcomeBanner

func PrintWelcomeBanner(out io.Writer, cfg *config.Root, model, projHex, projRoot string, replShellFirst bool, updateNotice *updater.Notice)

func PrintWelcomeBannerSized added in v2026.609.0

func PrintWelcomeBannerSized(out io.Writer, termW int, cfg *config.Root, model, projHex, projRoot string, replShellFirst bool, updateNotice *updater.Notice)

func Prompt

func Prompt(rl *readline.Instance, prompt string) (string, error)

func Run

func Run(loop *Loop) error

func ShellPrefixNormalizedForTest added in v2026.606.0

func ShellPrefixNormalizedForTest(buffer string, shellFirst bool) string

func StdinIsTerminal

func StdinIsTerminal() bool

func TryPasteImageAtCursor

func TryPasteImageAtCursor(stderr io.Writer, saveImage func() (tag string, err error), line []rune, pos int, key rune) ([]rune, int, bool)

func VisualRowsWithGhostForTest added in v2026.606.0

func VisualRowsWithGhostForTest(width int, prompt, line, ghost string) int

Types

type InputHistoryTest added in v2026.602.4

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

func NewInputHistoryForTest added in v2026.602.4

func NewInputHistoryForTest() *InputHistoryTest

func (*InputHistoryTest) Add added in v2026.602.4

func (h *InputHistoryTest) Add(s string)

func (*InputHistoryTest) AddWithMode added in v2026.606.0

func (h *InputHistoryTest) AddWithMode(s string, shellFirst bool)

func (*InputHistoryTest) Next added in v2026.602.4

func (h *InputHistoryTest) Next() (string, bool)

func (*InputHistoryTest) Prev added in v2026.602.4

func (h *InputHistoryTest) Prev(draft string) (string, bool)

func (*InputHistoryTest) ShellMatch added in v2026.606.0

func (h *InputHistoryTest) ShellMatch(prefix string) string

type Loop

type Loop struct {
	RL  *readline.Instance
	Out io.Writer
	Ctx context.Context

	InputInterrupt         <-chan struct{}
	PrepareStartupNotice   func()
	TakeStartupNotice      func() bool
	CompleteEnv            replcomplete.ReplCompleteEnv
	FinishSessionLoad      func()
	PromptPrimary          func() string
	PromptContinue         func() string
	HandleSlash            func(line string) error
	SlashDeps              func() commands.Deps
	OnUserMessage          func(line string) error
	ClipboardPasteForStdin func() (tag string, ok bool)
	SaveClipboardImage     func() (tag string, err error)
}

type MultilineEditorTest added in v2026.602.4

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

func NewMultilineEditorForTest added in v2026.602.4

func NewMultilineEditorForTest(loop *Loop, history *InputHistoryTest, lines []string, row, col, width int) *MultilineEditorTest

func (*MultilineEditorTest) AcceptSuggestAll added in v2026.606.0

func (e *MultilineEditorTest) AcceptSuggestAll()

func (*MultilineEditorTest) Col added in v2026.602.4

func (e *MultilineEditorTest) Col() int

func (*MultilineEditorTest) Complete added in v2026.602.4

func (e *MultilineEditorTest) Complete() bool

func (*MultilineEditorTest) Line added in v2026.602.4

func (e *MultilineEditorTest) Line(i int) string

func (*MultilineEditorTest) RecomputeSuggest added in v2026.606.0

func (e *MultilineEditorTest) RecomputeSuggest()

func (*MultilineEditorTest) Row added in v2026.602.4

func (e *MultilineEditorTest) Row() int

func (*MultilineEditorTest) String added in v2026.602.4

func (e *MultilineEditorTest) String() string

func (*MultilineEditorTest) SuggestSuffix added in v2026.606.0

func (e *MultilineEditorTest) SuggestSuffix() string

func (*MultilineEditorTest) Up added in v2026.602.4

func (e *MultilineEditorTest) Up()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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