Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions sshd/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,13 @@ func (t *Terminal) Env() Env {
}

// Term returns the terminal string value as set by the pty.
// If there was no pty request, this is empty.
// If there was no pty request, it falls back to the TERM value passed in as an
// Env variable.
func (t *Terminal) Term() string {
t.mu.Lock()
defer t.mu.Unlock()
return t.term
if t.term != "" {
return t.term
}
return Env(t.env).Get("TERM")
}