diff options
Diffstat (limited to 'internal/tmuxedit/capture.go')
| -rw-r--r-- | internal/tmuxedit/capture.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/internal/tmuxedit/capture.go b/internal/tmuxedit/capture.go deleted file mode 100644 index f4e3a67..0000000 --- a/internal/tmuxedit/capture.go +++ /dev/null @@ -1,23 +0,0 @@ -package tmuxedit - -import ( - "fmt" - "strings" -) - -func capturePane(paneID string) (string, error) { - return tmuxEditDeps{}.capture(paneID) -} - -// capture retrieves the visible content of a tmux pane via `tmux capture-pane -// -p -t <paneID>`. The -p flag prints to stdout instead of to a paste buffer. -func (d tmuxEditDeps) capture(paneID string) (string, error) { - if d.capturePane != nil { - return d.capturePane(paneID) - } - out, err := d.command("tmux", "capture-pane", "-p", "-t", paneID) - if err != nil { - return "", fmt.Errorf("capture-pane failed for %s: %w", paneID, err) - } - return strings.TrimRight(string(out), "\n"), nil -} |
