webexec

package
v0.0.0-...-6ed5ca5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

Make HTTP Handler

import (
	"github.com/OutOfBedlam/webterm"
	"github.com/OutOfBedlam/webterm/webexec"
)

mux := http.NewServeMux()
mux.Handle("/web/term/", mc.makeEXEC("/web/term/"))

func makeEXEC(cutPrefix string) http.Handler {
	term := webterm.New(
		&webexec.WebExec{
			Command: "/usr/bin/zsh",
			Args:    []string{"-il"},
			Dir:     "/tmp/",
		},
		webterm.WithCutPrefix(cutPrefix),
		webterm.WithTheme(webterm.ThemeDracula),
	)
	return term
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WebExec

type WebExec struct {
	Command string
	Args    []string
	Dir     string
}

func (*WebExec) Session

func (we *WebExec) Session() (webterm.Session, error)

func (*WebExec) Template

func (we *WebExec) Template() (*template.Template, any)

type WebExecSession

type WebExecSession struct {
	WebExec
	// contains filtered or unexported fields
}

func (*WebExecSession) Close

func (wes *WebExecSession) Close() error

func (*WebExecSession) Control

func (wes *WebExecSession) Control(data []byte) error

func (*WebExecSession) Open

func (wes *WebExecSession) Open() error

func (*WebExecSession) Read

func (wes *WebExecSession) Read(p []byte) (n int, err error)

func (*WebExecSession) SetWinSize

func (wes *WebExecSession) SetWinSize(cols int, rows int) error

func (*WebExecSession) Write

func (wes *WebExecSession) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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