terminal

package module
v0.0.0-...-ee501b2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: BSD-3-Clause Imports: 22 Imported by: 0

README

Fyne Terminal

Un emulador de terminal Fyne toolkit, soportado en Linux, macOS, Windows and BSD. Con capacidad de transmitir la terminal en un servicio web del puerto 80.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Title         string
	Rows, Columns uint
}

Config is the state of a terminal, updated upon certain actions or commands. Use Terminal.OnConfigure hook to register for changes.

type Terminal

type Terminal struct {
	widget.BaseWidget
	fyne.ShortcutHandler
	Content *widget.TextGrid
	// contains filtered or unexported fields
}

Terminal is a terminal widget that loads a shell and handles input/output.

func New

func New() *Terminal

New sets up a new terminal instance with the bash shell

func (*Terminal) AcceptsTab

func (t *Terminal) AcceptsTab() bool

AcceptsTab indicates that this widget will use the Tab key (avoids loss of focus).

func (*Terminal) AddListener

func (t *Terminal) AddListener(listener chan Config)

AddListener registers a new outgoing channel that will have our Config sent each time it changes.

func (*Terminal) CreateRenderer

func (t *Terminal) CreateRenderer() fyne.WidgetRenderer

CreateRenderer requests a new renderer for this terminal (just a wrapper around the TextGrid)

func (*Terminal) Cursor

func (t *Terminal) Cursor() desktop.Cursor

Cursor is used for displaying a specific cursor.

func (*Terminal) DragEnd

func (t *Terminal) DragEnd()

DragEnd is called by fyne when the left mouse is released after a Drag event.

func (*Terminal) Dragged

func (t *Terminal) Dragged(d *fyne.DragEvent)

Dragged is called by fyne when the left mouse is down and moved whilst over the widget.

func (*Terminal) Exit

func (t *Terminal) Exit()

Exit requests that this terminal exits. If there are embedded shells it will exit the child one only.

func (*Terminal) FocusGained

func (t *Terminal) FocusGained()

FocusGained notifies the terminal that it has focus

func (*Terminal) FocusLost

func (t *Terminal) FocusLost()

FocusLost tells the terminal it no longer has focus

func (*Terminal) Focused

func (t *Terminal) Focused() bool

Focused is used to determine if this terminal currently has focus

func (*Terminal) KeyDown

func (t *Terminal) KeyDown(e *fyne.KeyEvent)

KeyDown is called when we get a down key event

func (*Terminal) KeyUp

func (t *Terminal) KeyUp(e *fyne.KeyEvent)

KeyUp is called when we get an up key event

func (*Terminal) MinSize

func (t *Terminal) MinSize() fyne.Size

MinSize provides a size large enough that a terminal could technically funcion.

func (*Terminal) MouseDown

func (t *Terminal) MouseDown(ev *desktop.MouseEvent)

MouseDown handles the down action for desktop mouse events.

func (*Terminal) MouseUp

func (t *Terminal) MouseUp(ev *desktop.MouseEvent)

MouseUp handles the up action for desktop mouse events.

func (*Terminal) RemoveListener

func (t *Terminal) RemoveListener(listener chan Config)

RemoveListener de-registers a Config channel and closes it

func (*Terminal) Resize

func (t *Terminal) Resize(s fyne.Size)

Resize is called when this terminal widget has been resized. It ensures that the virtual terminal is within the bounds of the widget.

func (*Terminal) RunLocalShell

func (t *Terminal) RunLocalShell() error

RunLocalShell starts the terminal by loading a shell and starting to process the input/output.

func (*Terminal) RunWithConnection

func (t *Terminal) RunWithConnection(in io.WriteCloser, out io.Reader) error

RunWithConnection starts the terminal by connecting to an external resource like an SSH connection.

func (*Terminal) SelectedText

func (t *Terminal) SelectedText() string

SelectedText gets the text that is currently selected.

func (*Terminal) SetDebug

func (t *Terminal) SetDebug(debug bool)

SetDebug turns on output about terminal codes and other errors if the parameter is `true`.

func (*Terminal) SetStartDir

func (t *Terminal) SetStartDir(path string)

SetStartDir can be called before one of the Run calls to specify the initial directory.

func (*Terminal) Tapped

func (t *Terminal) Tapped(ev *fyne.PointEvent)

Tapped makes sure we ask for focus if user taps us.

func (*Terminal) TouchCancel

func (t *Terminal) TouchCancel(ev *mobile.TouchEvent)

TouchCancel handles the tap action for mobile apps that lose focus during tap.

func (*Terminal) TouchDown

func (t *Terminal) TouchDown(ev *mobile.TouchEvent)

TouchDown handles the down action for mobile touch events.

func (*Terminal) TouchUp

func (t *Terminal) TouchUp(ev *mobile.TouchEvent)

TouchUp handles the up action for mobile touch events.

func (*Terminal) TypedKey

func (t *Terminal) TypedKey(e *fyne.KeyEvent)

TypedKey will be called if a non-printable keyboard event occurs

func (*Terminal) TypedRune

func (t *Terminal) TypedRune(r rune)

TypedRune is called when the user types a visible character

func (*Terminal) TypedShortcut

func (t *Terminal) TypedShortcut(s fyne.Shortcut)

TypedShortcut handles key combinations, we pass them on to the tty.

func (*Terminal) Write

func (t *Terminal) Write(b []byte) (int, error)

Write is used to send commands into an open terminal connection. Errors will be returned if the connection is not established, has closed, or there was a problem in transmission.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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