Skip to content

Commit

Permalink
fix #13: set seq to screen only when STY is set (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachcheung authored Sep 23, 2024
1 parent 3f58aeb commit d2bfbf6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func main() {
pflag.Lookup("man").Hidden = true

if *version {
fmt.Printf("%s version %s (%s)", ProjectName, Version, CommitSHA)
fmt.Printf("%s version %s (%s)\n", ProjectName, Version, CommitSHA)
return
}

Expand Down Expand Up @@ -147,7 +147,11 @@ func main() {
// Detect `screen` terminal type
if term := os.Getenv("TERM"); term != "" {
if strings.HasPrefix(term, "screen") {
seq = seq.Screen()
if sty := os.Getenv("STY"); sty != "" {
// only when `STY` has been set
// it's normal to see `TERM` is `screen` in tmux
seq = seq.Screen()
}
}
}

Expand Down

0 comments on commit d2bfbf6

Please sign in to comment.