Documentation
¶
Overview ¶
Package terminal serves the terminal socket: a page attaches to a tab's tmux session through a pty and talks a small binary protocol. One byte of type, then the payload:
page → runtime: 0x00 keystrokes, 0x02 resize (uint16 cols, uint16 rows, big endian), 0x03 heartbeat,
0x04 kill the session, 0x05 text from the composer, 0x06 the id of the composer message that the
next 0x05 carries ({"id": "…"})
runtime → page: 0x01 output (UTF-8, whole characters), 0x03 heartbeat answer
Index ¶
- type Bridge
- type Config
- type Server
- func (s *Server) Attached(session string) bool
- func (s *Server) Handle(w http.ResponseWriter, r *http.Request)
- func (s *Server) Pause(session string) (cols, rows int, ok bool)
- func (s *Server) Resize(session string, cols, rows int)
- func (s *Server) Resume(session string)
- func (s *Server) Shutdown()
- func (s *Server) Size(session string) (cols, rows int, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge interface {
// ClaimPrompt is false when the composer message went into a pane already: it must not be typed again.
ClaimPrompt(id, session, text string) bool
// PromptEnter notes that Enter was passed on in the session, for the prompt-submit timing.
PromptEnter(session string)
// ReconcileCwd: a tab's session is gone, its saved folder may need fixing.
ReconcileCwd(session string)
}
Bridge is what the terminal tells the rest of the runtime.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the open terminals.
func (*Server) Handle ¶
func (s *Server) Handle(w http.ResponseWriter, r *http.Request)
Handle upgrades an already authenticated request for `?session=` and serves it until either side closes.
func (*Server) Pause ¶
Pause stops the session's output to the page while the pane is captured at another width; false when there is no terminal or it is paused already.