From b7e4a9fc0859986f23d682c5de1e008c697708d3 Mon Sep 17 00:00:00 2001 From: theimpostor Date: Sun, 18 Aug 2024 16:46:40 -0500 Subject: add check for zellij, unsupported with paste --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index a3b759a..a663bbf 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,7 @@ var ( oscClose string = "\a" isScreen bool isTmux bool + isZellij bool verboseFlag bool logfileFlag string deviceFlag string @@ -90,6 +91,9 @@ func initLogging() (logfile *os.File) { } func identifyTerm() { + if os.Getenv("ZELLIJ") != "" { + isZellij = true + } if os.Getenv("TMUX") != "" { isTmux = true } else if ti, err := tcell.LookupTerminfo(os.Getenv("TERM")); err != nil { @@ -163,6 +167,9 @@ func copy(fnames []string) error { } func paste() error { + if isZellij { + return fmt.Errorf("paste unsupported under zellij, unset ZELLIJ env var to force") + } timeout := time.Duration(timeoutFlag*1_000_000_000) * time.Nanosecond slog.Debug(fmt.Sprintf("Beginning osc52 paste operation, timeout: %s", timeout)) if data, err := func() ([]byte, error) { -- cgit v1.2.3