mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-12 23:27:17 +03:00
sshd: Terminal.Term() fallback to Env TERM
This commit is contained in:
parent
b9aa7a6a0c
commit
f113a130ae
@ -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")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user