{"record":{"id":"e7438b900eb5f527","repo":"chenhg5/cc-connect","slug":"tmux-tmux-not-found-in-path","errorCode":null,"errorMessage":"tmux: 'tmux' not found in PATH","messagePattern":"tmux: 'tmux' not found in PATH","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/tmux/tmux.go","lineNumber":125,"sourceCode":"\tvar stripPatterns []string\n\tswitch v := opts[\"strip_patterns\"].(type) {\n\tcase []string:\n\t\tstripPatterns = v\n\tcase []any:\n\t\tfor _, item := range v {\n\t\t\tif s, ok := item.(string); ok {\n\t\t\t\tstripPatterns = append(stripPatterns, s)\n\t\t\t}\n\t\t}\n\tcase nil:\n\t\t// default: strip Claude Code's mode status line\n\t\tstripPatterns = []string{`⏵⏵.*\\(shift\\+tab to cycle\\)`}\n\t}\n\n\twindowPerSession, _ := opts[\"window_per_session\"].(bool)\n\n\tif _, err := exec.LookPath(\"tmux\"); err != nil {\n\t\treturn nil, fmt.Errorf(\"tmux: 'tmux' not found in PATH\")\n\t}\n\n\treturn &Agent{\n\t\tsessionName:      sessionName,\n\t\tpane:             pane,\n\t\tworkDir:          workDir,\n\t\tautoCreate:       autoCreate,\n\t\tshell:            shell,\n\t\tinitCmd:          initCmd,\n\t\tstartupWaitMs:    startupWaitMs,\n\t\tpromptPat:        promptPat,\n\t\tpollMs:           pollMs,\n\t\tstripInputBlock:  stripInputBlock,\n\t\tstripPatterns:    stripPatterns,\n\t\twindowPerSession: windowPerSession,\n\t}, nil\n}\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/tmux/tmux.go#L107-L143","documentation":"New() runs exec.LookPath(\"tmux\") to verify the tmux binary is invocable and fails construction when it is not on PATH. This catches the missing external dependency at agent-creation time instead of failing later on every exec call.","triggerScenarios":"core.CreateAgent(\"tmux\", opts) on a machine where tmux is not installed or is outside PATH for the process running cc-connect (e.g. systemd/launchd service with a minimal PATH, or tmux installed via a package manager into a non-standard prefix).","commonSituations":"tmux never installed on the host; daemon environment has PATH=/usr/bin:/bin while tmux lives in /usr/local/bin or ~/.linuxbrew/bin; container image missing tmux.","solutions":["Install tmux (apt/brew/dnf install tmux)","Ensure the tmux binary's directory is in PATH for the cc-connect process; for systemd use Environment=PATH=... in the unit","Symlink tmux into a PATH directory: ln -s $(which tmux) /usr/local/bin/tmux","Verify with: sudo -u <cc-connect-user> which tmux"],"exampleFix":"// before\n# systemd unit\neEnvironment omitted -> PATH=/usr/bin:/bin, tmux in /usr/local/bin not found\n\n// after\n# /etc/systemd/system/cc-connect.service\n[Service]\nEnvironment=PATH=/usr/local/bin:/usr/bin:/bin","handlingStrategy":"validation","validationCode":"if _, err := exec.LookPath(\"tmux\"); err != nil {\n    return errors.New(\"tmux binary required: install tmux or fix PATH for the cc-connect process\")\n}","typeGuard":null,"tryCatchPattern":"_, err := tmux.New(opts)\nif err != nil && strings.Contains(err.Error(), \"not found in PATH\") {\n    slog.Error(\"tmux missing\", \"hint\", \"install tmux and ensure PATH includes it in daemon env\")\n    return err\n}","preventionTips":["Install tmux on all hosts running cc-connect","Set an explicit PATH in systemd/launchd unit files","Check dependencies at service startup with `cc-connect doctor` if available","In containers, add tmux to the image"],"tags":["go","tmux","path","dependency"],"backgroundTag":"missing-env-var","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}