Use $TMUX env variable to detect tmux session

master
Ivan Klymenchenko 3 years ago
parent 4bbb374ccd
commit edc73343cc

@ -7,6 +7,7 @@ type Context struct {
} }
func CreateContext() *Context { func CreateContext() *Context {
insideTmuxSession := os.Getenv("TERM") == "screen" _, tmux := os.LookupEnv("TMUX")
insideTmuxSession := os.Getenv("TERM") == "screen" || tmux
return &Context{insideTmuxSession} return &Context{insideTmuxSession}
} }

@ -6,7 +6,7 @@ import (
"github.com/docopt/docopt-go" "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: Usage:
smug <command> <project> [-w <window>]... [--attach] [--debug] smug <command> <project> [-w <window>]... [--attach] [--debug]

Loading…
Cancel
Save