Merge branch 'pr-374-ssh-remote-cli-relay' into issue-151-ssh-remote-port-proxying
# Conflicts: # CLI/cmux.swift # Sources/ContentView.swift # Sources/GhosttyTerminalView.swift # Sources/Panels/TerminalPanel.swift # Sources/SocketControlSettings.swift # Sources/TabManager.swift # Sources/TerminalController.swift # Sources/Workspace.swift # daemon/remote/README.md # daemon/remote/cmd/cmuxd-remote/main.go # docs/remote-daemon-spec.md # tests_v2/test_ssh_remote_cli_metadata.py
This commit is contained in:
commit
30bb74dc92
26 changed files with 4896 additions and 1954 deletions
|
|
@ -11,6 +11,7 @@ import (
|
|||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
|
@ -62,6 +63,11 @@ type sessionState struct {
|
|||
const maxRPCFrameBytes = 4 * 1024 * 1024
|
||||
|
||||
func main() {
|
||||
// Busybox-style: if invoked as "cmux" (via symlink), act as CLI relay.
|
||||
base := filepath.Base(os.Args[0])
|
||||
if base == "cmux" {
|
||||
os.Exit(runCLI(os.Args[1:]))
|
||||
}
|
||||
os.Exit(run(os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
|
||||
}
|
||||
|
||||
|
|
@ -91,6 +97,8 @@ func run(args []string, stdin io.Reader, stdout, stderr io.Writer) int {
|
|||
return 1
|
||||
}
|
||||
return 0
|
||||
case "cli":
|
||||
return runCLI(args[1:])
|
||||
default:
|
||||
usage(stderr)
|
||||
return 2
|
||||
|
|
@ -101,6 +109,7 @@ func usage(w io.Writer) {
|
|||
_, _ = fmt.Fprintln(w, "Usage:")
|
||||
_, _ = fmt.Fprintln(w, " cmuxd-remote version")
|
||||
_, _ = fmt.Fprintln(w, " cmuxd-remote serve --stdio")
|
||||
_, _ = fmt.Fprintln(w, " cmuxd-remote cli <command> [args...]")
|
||||
}
|
||||
|
||||
func runStdioServer(stdin io.Reader, stdout io.Writer) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue