Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/ttyd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func ttydArgs(sessionName string, port int) []string {
"--base-path", "/terminal/" + sessionName,
"-t", fmt.Sprintf("scrollback=%d", ttydScrollbackLines),
"-t", "fontFamily=HackNerdFontMono, monospace",
"-t", "macOptionClickForcesSelection=true",
"tmux", "new-session", "-A", "-s", webSession, "-t", "=" + sessionName,
}
}
Expand Down
24 changes: 14 additions & 10 deletions web/ttyd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ import (
"time"
)

func TestTtydArgsIncludeMobileScrollback(t *testing.T) {
func TestTtydArgsIncludeClientOptions(t *testing.T) {
args := ttydArgs("demo/session", 7681)
want := fmt.Sprintf("scrollback=%d", ttydScrollbackLines)
found := false
for i := 0; i < len(args)-1; i++ {
if args[i] == "-t" && args[i+1] == want {
found = true
break
for _, want := range []string{
fmt.Sprintf("scrollback=%d", ttydScrollbackLines),
"macOptionClickForcesSelection=true",
} {
found := false
for i := 0; i < len(args)-1; i++ {
if args[i] == "-t" && args[i+1] == want {
found = true
break
}
}
if !found {
t.Fatalf("expected ttyd args to include %q, got %v", want, args)
}
}
if !found {
t.Fatalf("expected ttyd args to include %q, got %v", want, args)
}
}

Expand Down
Loading