diff options
| author | theimpostor <theimpostor@users.noreply.github.com> | 2024-08-18 08:54:30 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-18 08:54:30 -0500 |
| commit | d6a88bac9c08e2c0955b47b955df13c7616a52ff (patch) | |
| tree | 31d0b30964d64fc5f3f678c377dddd24f113692d | |
| parent | e305cfc06a1ec0341efebda36b76b8aeee6b3380 (diff) | |
| parent | 84302de27eb132d5c866a96947ac56ea7d65bf73 (diff) | |
Merge pull request #10 from Javex/main
Add support for tmux (#3)
| -rw-r--r-- | main.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -23,6 +23,7 @@ var ( oscOpen string = "\x1b]52;c;" oscClose string = "\a" isScreen bool + isTmux bool verboseFlag bool logfileFlag string deviceFlag string @@ -90,7 +91,9 @@ func initLogging() (logfile *os.File) { } func identifyTerm() { - if ti, err := tcell.LookupTerminfo(os.Getenv("TERM")); err != nil { + if os.Getenv("TMUX") != "" { + isTmux = true + } else if ti, err := tcell.LookupTerminfo(os.Getenv("TERM")); err != nil { slog.Error(fmt.Sprintf("Failed to lookup terminfo: %v", err)) } else { slog.Debug(fmt.Sprintf("term name: %s, aliases: %q", ti.Name, ti.Aliases)) @@ -103,6 +106,10 @@ func identifyTerm() { slog.Debug("Setting screen dcs passthrough") oscOpen = "\x1bP" + oscOpen oscClose = oscClose + "\x1b\\" + } else if isTmux { + slog.Debug("Setting tmux dcs passthrough") + oscOpen = "\x1bPtmux;\x1b" + oscOpen + oscClose = oscClose + "\x1b\\" } } |
