Add the app's terminal surface: bottom panel, floating window and full-screen page
This commit is contained in:
@@ -92,8 +92,11 @@ type TerminalRecord struct {
|
||||
Reason string `json:"reason,omitempty"`
|
||||
Cols int `json:"cols"`
|
||||
Rows int `json:"rows"`
|
||||
// OutputEnd is the absolute byte count this server process has read;
|
||||
// it restarts at zero when a restarted server reattaches.
|
||||
// Stream names this server process's output stream of the terminal;
|
||||
// OutputEnd is the absolute byte count read into it. A restarted server
|
||||
// that reattaches starts a new stream at zero, so a client holding
|
||||
// another stream reads the terminal again from its start.
|
||||
Stream string `json:"stream,omitempty"`
|
||||
OutputEnd int64 `json:"output_end"`
|
||||
Output string `json:"output,omitempty"`
|
||||
OutputStart int64 `json:"output_start,omitempty"`
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -30,6 +32,9 @@ type terminalProcess struct {
|
||||
}
|
||||
|
||||
func newTerminalProcess(record protocol.TerminalRecord) *terminalProcess {
|
||||
var stream [6]byte
|
||||
_, _ = rand.Read(stream[:])
|
||||
record.Stream = hex.EncodeToString(stream[:])
|
||||
return &terminalProcess{
|
||||
record: record,
|
||||
out: newChatShellOutput(protocol.TerminalRetained),
|
||||
|
||||
Reference in New Issue
Block a user