terminal

package
v0.0.0-...-8bf3613 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package terminal implements functions for responding to user input and dispatching to appropriate backend commands.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ShortLoadConfig loads less information, not following pointers
	// and limiting struct fields loaded to 3.
	ShortLoadConfig = api.LoadConfig{MaxStringLen: 64, MaxStructFields: 3}
)

Functions

This section is empty.

Types

type DebugSession

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

DebugSession represents the commands for Delve terminal process.

func NewDebugSession

func NewDebugSession(client service.Client) *DebugSession

NewDebugSession returns a Commands struct with default commands defined.

func (*DebugSession) Call

func (s *DebugSession) Call(cmdstr string, t *Term) error

Call takes a command to execute.

func (*DebugSession) CallWithContext

func (s *DebugSession) CallWithContext(cmdstr string, t *Term, ctx callContext) error

CallWithContext takes a command and a context that command should be executed in.

func (*DebugSession) Find

func (s *DebugSession) Find(cmdstr string, prefix cmdPrefix) *command

Find will look up the command function for the given command input. If it cannot find the command it will default to noCmdAvailable(). If the command is an empty string it will replay the last command.

func (*DebugSession) Merge

func (s *DebugSession) Merge(allAliases map[string][]string)

Merge takes aliases defined in the config struct and merges them with the default aliases.

func (*DebugSession) Register

func (s *DebugSession) Register(cmdstr string, cf cmdfunc, helpMsg string)

Register custom commands. Expects cf to be a func of type cmdfunc, returning only an error.

type ExitRequestError

type ExitRequestError struct{}

ExitRequestError is returned when the user exits Delve.

func (ExitRequestError) Error

func (ere ExitRequestError) Error() string

type Term

type Term struct {
	InitFile string
	// contains filtered or unexported fields
}

Term represents the terminal running dlv.

func New

func New(client service.Client, conf *config.Config) *Term

New returns a new Term.

func (*Term) Close

func (t *Term) Close()

Close returns the terminal to its previous mode.

func (*Term) IsTraceNonInteractive

func (t *Term) IsTraceNonInteractive() bool

func (*Term) RedirectTo

func (t *Term) RedirectTo(w io.Writer)

RedirectTo redirects the output of this terminal to the specified writer.

func (*Term) Run

func (t *Term) Run() (int, error)

Run begins running dlv in the terminal.

func (*Term) SetTraceNonInteractive

func (t *Term) SetTraceNonInteractive()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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