Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly get tmux allow-passthrough option #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Correctly get tmux allow-passthrough option
This gets any of the session, window, or global option for
allow-passthrough, rather than just the session option
mhanberg committed Feb 27, 2025

Verified

This commit was signed with the committer’s verified signature.
mhanberg Mitchell Hanberg
commit 15fdf09e4954a1513099c730ce61588da18f7e9c
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
@@ -185,11 +185,11 @@ func (w *chunkingWriter) Write(p []byte) (n int, err error) {
func copy(fnames []string) error {
// copy
if isTmux {
if out, err := exec.Command("tmux", "show", "-v", "allow-passthrough").Output(); err != nil {
return fmt.Errorf("Error running 'tmux show -v allow-passthrough': %w", err)
if out, err := exec.Command("tmux", "show", "-gwsv", "allow-passthrough").Output(); err != nil {
return fmt.Errorf("Error running 'tmux show -gwsv allow-passthrough': %w", err)
} else {
outStr := strings.TrimSpace(string(out))
debugLog.Println("'tmux show -v allow-passthrough':", outStr)
debugLog.Println("'tmux show -gwsv allow-passthrough':", outStr)
if outStr != "on" && outStr != "all" {
return fmt.Errorf("tmux allow-passthrough must be set to 'on' or 'all'")
}