# command.CommandResult.stderr_utf8

- **Module:** command.CommandResult
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/8a648c0894dfffc9303583f753b6c8ae01f2fe76/crates/libtmux/src/command.rs#L1019
- **Page:** https://libtmux.org/reference/rs/command-commandresult-stderr_utf8/

```
command.CommandResult.stderr_utf8(self) -> Result<&str, std::str::Utf8Error>
```

Borrow stderr as UTF-8 without copying or replacement.

# Errors

Returns the borrowed decoding error when stderr is not valid UTF-8.

## Example

```rust
let server = libtmux::Server::builder().socket_path("/tmp/libtmux-rs-test/result-stderr-utf8.sock").build()?;
let result = server.cmd(libtmux::Command::new("list-sessions")).await?;
let _text = result.stderr_utf8()?;
server.shutdown().await?;
```
