Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: respect $TERM and force colors #281

Open
wants to merge 3 commits into
base: beta
Choose a base branch
from
Open

fix: respect $TERM and force colors #281

wants to merge 3 commits into from

Conversation

aymanbagabas
Copy link
Member

No description provided.

@tartavull
Copy link

@aymanbagabas could you explain the motivation behind this?

pty, _, ok := s.Pty()
environ := s.Environ()
if pty.Term != "" {
environ = append(environ, "TERM="+pty.Term)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't TERM already in s.Environ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, TERM is part of the SSH pty-req while environ variables are part of the env SSH request.
See https://www.rfc-editor.org/rfc/rfc4254#section-6.2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TERM shouldn't be exposed when terminal is not a PTY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants