diff --git a/web/ttyd.go b/web/ttyd.go index 46611ec..55133a2 100644 --- a/web/ttyd.go +++ b/web/ttyd.go @@ -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, } } diff --git a/web/ttyd_test.go b/web/ttyd_test.go index 2dc84bd..3011c3c 100644 --- a/web/ttyd_test.go +++ b/web/ttyd_test.go @@ -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) } }