Skip to content

Commit

Permalink
docs: tmux notes
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Oct 12, 2022
1 parent cd7fdfe commit 61c1a05
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,33 @@ output := NewOutput(sshSession, envs)
output.Copy("Hello awesome!")
```

If you're using tmux, you could pass the `TMUX` environment variable to help detect tmux:

```sh
ssh -o SendEnv=TMUX <host>
```

### Tmux users

If you're using tmux, make sure you set `set -g default-terminal` in your
`~/.tmux.conf` file, to a value that starts with `tmux-`. `tmux-256color` for
instance. See [this](https://github.com/tmux/tmux/wiki/FAQ#why-do-you-use-the-screen-terminal-description-inside-tmux)
If you're using tmux, make sure you set `set -g default-terminal` in your tmux
config, to a value that starts with `tmux-`. `tmux-256color` for instance. See
[this](https://github.com/tmux/tmux/wiki/FAQ#why-do-you-use-the-screen-terminal-description-inside-tmux)
for more details.

You can instead pass the `TMUX` environment variable:
`go-osc52` will wrap the OSC52 sequence in a `tmux` escape sequence if tmux is
detected. If you're running tmux >= 3.3, OSC52 won't work and you'll need to set
the `set -g allow-passthrough on` in your tmux config.

```sh
ssh -o SendEnv=TMUX <host>
```tmux
set -g allow-passthrough on
```

or set `set -g set-clipboard on` in your tmux config and use your outer terminal in your code instead:

```go
// Assuming this code is running in tmux >= 3.3 in kitty
seq := osc52.Sequence("Hello awesome!", "xterm-kitty", osc52.ClipboardC)
os.Stderr.WriteString(seq)
```

## Credits
Expand Down

0 comments on commit 61c1a05

Please sign in to comment.