Using shell from config if specified

Don't execute extra command if it's not needed
This commit is contained in:
Vladimir Kravets 2018-12-02 13:00:28 +02:00
parent 58dd4bf3a1
commit 9ebee461e4
1 changed files with 7 additions and 7 deletions

View File

@ -31,13 +31,13 @@ func main() {
logger.Fatalf("Failed to allocate pty: %s", err) logger.Fatalf("Failed to allocate pty: %s", err)
} }
shellStr, err := loginshell.Shell() shellStr := conf.Shell
if shellStr == "" {
loginShell, err := loginshell.Shell()
if err != nil { if err != nil {
logger.Fatalf("Failed to ascertain your shell: %s", err) logger.Fatalf("Failed to ascertain your shell: %s", err)
} }
shellStr = loginShell
if conf.Shell != "" {
shellStr = conf.Shell
} }
os.Setenv("TERM", "xterm-256color") // controversial! easier than installing terminfo everywhere, but obviously going to be slightly different to xterm functionality, so we'll see... os.Setenv("TERM", "xterm-256color") // controversial! easier than installing terminfo everywhere, but obviously going to be slightly different to xterm functionality, so we'll see...