diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-08 12:02:40 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-08 12:02:40 +0300 |
| commit | 75cf6abd55bfb60324fc47cf91eac08dbb8b87b4 (patch) | |
| tree | 6ef90d8014fe4d9a757d3f7e95bf736b70e4c685 /internal/tmux/tmux.go | |
| parent | 0dcf347c3fbc6e4ffb7e46294f5dd92dbbcd98ef (diff) | |
docs: move tmux documentation to its own file
Diffstat (limited to 'internal/tmux/tmux.go')
| -rw-r--r-- | internal/tmux/tmux.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/internal/tmux/tmux.go b/internal/tmux/tmux.go index 63b5660..6d75a44 100644 --- a/internal/tmux/tmux.go +++ b/internal/tmux/tmux.go @@ -1,18 +1,20 @@ package tmux import ( - "os" - "os/exec" - "strconv" - "strings" + "os" + "os/exec" + "strconv" + "strings" ) // Available reports whether tmux is available and we appear to be in a tmux session. func Available() bool { return HasBinary() && InSession() } // HasBinary reports whether the tmux binary is on PATH. -var lookPath = exec.LookPath -var command = exec.Command +var ( + lookPath = exec.LookPath + command = exec.Command +) func HasBinary() bool { _, err := lookPath("tmux"); return err == nil } @@ -47,8 +49,8 @@ func SplitRun(opts SplitOpts, argv []string) error { // tmux takes a single command string. Use a conservative shell join. cmdStr := shellJoin(argv) args = append(args, cmdStr) - c := command("tmux", args...) - return c.Run() + c := command("tmux", args...) + return c.Run() } // shellJoin quotes argv elements for safe use in a single shell command string. |
