# program.Program.output

- **Module:** program
- **Package:** libtmux
- **Language:** TypeScript
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-ts/blob/073b9d7dedad900bff6f5ec0ea47794e40225870/packages/libtmux/src/program.ts#L86
- **Page:** https://libtmux.org/en/ts/latest/reference/program-program-output/

```
async output(): Promise<string>
```

What the program has printed so far, as its terminal shows it.

Scrollback is included and wrapped lines are joined. Tabs and trailing
spaces are kept; colors and cursor movement are applied rather than
returned.

## Examples

```ts
await using program = await server.spawn(["echo", "hello"]);
await program.wait();
await program.output(); // "hello"
```

## tmux command

The tmux commands behind `output`.

- [`capture-pane`](/en/tmux/latest/manual/capture-pane/)
- [`display-message`](/en/tmux/latest/manual/display-message/)

## tmux C API

The C declarations in tmux that implement these commands.

- [`cmd_capture_pane_entry`](/en/tmux/latest/reference/c-variable-cmd_capture_pane_entry/) (attribute)
- [`cmd_capture_pane_exec`](/en/tmux/latest/reference/c-function-cmd-capture-pane-c-cmd_capture_pane_exec/) (function)
- [`cmd_display_message_entry`](/en/tmux/latest/reference/c-variable-cmd_display_message_entry/) (attribute)
- [`cmd_display_message_exec`](/en/tmux/latest/reference/c-function-cmd-display-message-c-cmd_display_message_exec/) (function)
