Skip to content

Commit

Permalink
Use $TMUX env variable to detect tmux session
Browse files Browse the repository at this point in the history
  • Loading branch information
ivaaaan committed Dec 30, 2020
1 parent 4bbb374 commit edc7334
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type Context struct {
}

func CreateContext() *Context {
insideTmuxSession := os.Getenv("TERM") == "screen"
_, tmux := os.LookupEnv("TMUX")
insideTmuxSession := os.Getenv("TERM") == "screen" || tmux
return &Context{insideTmuxSession}
}
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/docopt/docopt-go"
)

const usage = `Smug - tmux session manager. Version v0.1.4
const usage = `Smug - tmux session manager. Version v0.1.5
Usage:
smug <command> <project> [-w <window>]... [--attach] [--debug]
Expand Down

0 comments on commit edc7334

Please sign in to comment.