tmux.ts - v0.1.3
    Preparing search index...

    Variable capturePaneConst

    capturePane: (
        options?:
            | {
                alternateScreen?: boolean;
                bufferName?: undefined;
                endLine?: number
                | "-";
                escapeNonPrintable?: boolean;
                escapeSequences?: boolean;
                joinWrappedLines?: boolean;
                modeScreen?: boolean;
                pendingEscapeSequence?: boolean;
                preserveTrailingSpaces?: boolean;
                print?: true;
                quiet?: boolean;
                startLine?: number | "-";
                targetPane?: string;
                trimEmpty?: boolean;
            }
            | {
                alternateScreen?: boolean;
                bufferName: string;
                endLine?: number
                | "-";
                escapeNonPrintable?: boolean;
                escapeSequences?: boolean;
                joinWrappedLines?: boolean;
                modeScreen?: boolean;
                pendingEscapeSequence?: boolean;
                preserveTrailingSpaces?: boolean;
                print?: false;
                quiet?: boolean;
                startLine?: number | "-";
                targetPane?: string;
                trimEmpty?: boolean;
            },
    ) => Effect<
        string,
        TmuxCommandOptionsError
        | TmuxProcessRunError,
        TmuxProcess,
    > = ...

    Capture the contents of a tmux pane (tmux capture-pane).

    Type Declaration

      • (
            options?:
                | {
                    alternateScreen?: boolean;
                    bufferName?: undefined;
                    endLine?: number
                    | "-";
                    escapeNonPrintable?: boolean;
                    escapeSequences?: boolean;
                    joinWrappedLines?: boolean;
                    modeScreen?: boolean;
                    pendingEscapeSequence?: boolean;
                    preserveTrailingSpaces?: boolean;
                    print?: true;
                    quiet?: boolean;
                    startLine?: number | "-";
                    targetPane?: string;
                    trimEmpty?: boolean;
                }
                | {
                    alternateScreen?: boolean;
                    bufferName: string;
                    endLine?: number
                    | "-";
                    escapeNonPrintable?: boolean;
                    escapeSequences?: boolean;
                    joinWrappedLines?: boolean;
                    modeScreen?: boolean;
                    pendingEscapeSequence?: boolean;
                    preserveTrailingSpaces?: boolean;
                    print?: false;
                    quiet?: boolean;
                    startLine?: number | "-";
                    targetPane?: string;
                    trimEmpty?: boolean;
                },
        ): Effect<
            string,
            TmuxCommandOptionsError
            | TmuxProcessRunError,
            TmuxProcess,
        >
      • Parameters

        • Optionaloptions:
              | {
                  alternateScreen?: boolean;
                  bufferName?: undefined;
                  endLine?: number
                  | "-";
                  escapeNonPrintable?: boolean;
                  escapeSequences?: boolean;
                  joinWrappedLines?: boolean;
                  modeScreen?: boolean;
                  pendingEscapeSequence?: boolean;
                  preserveTrailingSpaces?: boolean;
                  print?: true;
                  quiet?: boolean;
                  startLine?: number | "-";
                  targetPane?: string;
                  trimEmpty?: boolean;
              }
              | {
                  alternateScreen?: boolean;
                  bufferName: string;
                  endLine?: number
                  | "-";
                  escapeNonPrintable?: boolean;
                  escapeSequences?: boolean;
                  joinWrappedLines?: boolean;
                  modeScreen?: boolean;
                  pendingEscapeSequence?: boolean;
                  preserveTrailingSpaces?: boolean;
                  print?: false;
                  quiet?: boolean;
                  startLine?: number | "-";
                  targetPane?: string;
                  trimEmpty?: boolean;
              }
          • {
                alternateScreen?: boolean;
                bufferName?: undefined;
                endLine?: number | "-";
                escapeNonPrintable?: boolean;
                escapeSequences?: boolean;
                joinWrappedLines?: boolean;
                modeScreen?: boolean;
                pendingEscapeSequence?: boolean;
                preserveTrailingSpaces?: boolean;
                print?: true;
                quiet?: boolean;
                startLine?: number | "-";
                targetPane?: string;
                trimEmpty?: boolean;
            }
            • Optional ReadonlyalternateScreen?: boolean

              Use the alternate screen instead of history (-a).

            • Optional ReadonlybufferName?: undefined
            • Optional ReadonlyendLine?: number | "-"

              Ending line: number, negative history offset, or "-" for visible end (-E).

            • Optional ReadonlyescapeNonPrintable?: boolean

              Escape non-printable characters as octal sequences (-C).

            • Optional ReadonlyescapeSequences?: boolean

              Include escape sequences for text and background attributes (-e).

            • Optional ReadonlyjoinWrappedLines?: boolean

              Join wrapped lines and preserve trailing spaces; implies trimEmpty (-J).

            • Optional ReadonlymodeScreen?: boolean

              Capture the screen for the active mode, if any (-M).

            • Optional ReadonlypendingEscapeSequence?: boolean

              Capture only the beginning of an incomplete escape sequence (-P).

            • Optional ReadonlypreserveTrailingSpaces?: boolean

              Preserve trailing spaces at each line's end (-N).

            • Optional Readonlyprint?: true

              Print captured content to stdout instead of a tmux buffer (-p).

            • Optional Readonlyquiet?: boolean

              Suppress errors for unavailable alternate/mode screens (-q).

            • Optional ReadonlystartLine?: number | "-"

              Starting line: number, negative history offset, or "-" for history start (-S).

            • Optional ReadonlytargetPane?: string

              Target pane to capture (-t).

            • Optional ReadonlytrimEmpty?: boolean

              Ignore trailing positions that do not contain a character (-T).

          • {
                alternateScreen?: boolean;
                bufferName: string;
                endLine?: number | "-";
                escapeNonPrintable?: boolean;
                escapeSequences?: boolean;
                joinWrappedLines?: boolean;
                modeScreen?: boolean;
                pendingEscapeSequence?: boolean;
                preserveTrailingSpaces?: boolean;
                print?: false;
                quiet?: boolean;
                startLine?: number | "-";
                targetPane?: string;
                trimEmpty?: boolean;
            }
            • Optional ReadonlyalternateScreen?: boolean

              Use the alternate screen instead of history (-a).

            • ReadonlybufferName: string

              Buffer name to write when not printing to stdout (-b).

            • Optional ReadonlyendLine?: number | "-"

              Ending line: number, negative history offset, or "-" for visible end (-E).

            • Optional ReadonlyescapeNonPrintable?: boolean

              Escape non-printable characters as octal sequences (-C).

            • Optional ReadonlyescapeSequences?: boolean

              Include escape sequences for text and background attributes (-e).

            • Optional ReadonlyjoinWrappedLines?: boolean

              Join wrapped lines and preserve trailing spaces; implies trimEmpty (-J).

            • Optional ReadonlymodeScreen?: boolean

              Capture the screen for the active mode, if any (-M).

            • Optional ReadonlypendingEscapeSequence?: boolean

              Capture only the beginning of an incomplete escape sequence (-P).

            • Optional ReadonlypreserveTrailingSpaces?: boolean

              Preserve trailing spaces at each line's end (-N).

            • Optional Readonlyprint?: false

              Explicitly do not print; write to bufferName instead (-p).

            • Optional Readonlyquiet?: boolean

              Suppress errors for unavailable alternate/mode screens (-q).

            • Optional ReadonlystartLine?: number | "-"

              Starting line: number, negative history offset, or "-" for history start (-S).

            • Optional ReadonlytargetPane?: string

              Target pane to capture (-t).

            • Optional ReadonlytrimEmpty?: boolean

              Ignore trailing positions that do not contain a character (-T).

        Returns Effect<string, TmuxCommandOptionsError | TmuxProcessRunError, TmuxProcess>

        The captured text when printed, otherwise an empty string.

    const text = await tmux.capturePane({ print: true, targetPane: "0" });

    await tmux.capturePane({
    print: false,
    bufferName: "snapshot",
    startLine: "-",
    });