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

Provide a value for TERM_PROGRAM in the environment #200

Closed
davep opened this issue Aug 31, 2023 · 6 comments
Closed

Provide a value for TERM_PROGRAM in the environment #200

davep opened this issue Aug 31, 2023 · 6 comments

Comments

@davep
Copy link

davep commented Aug 31, 2023

It's common for terminals to set the TERM_PROGRAM environment variable to something that identifies the terminal; this can be a handy diagnostic for those of us who develop code that runs inside terminals. Would you consider adding this to rio so that it identifies itself?

Also not uncommon is TERM_PROGRAM_VERSION for the version number.

@raphamorim
Copy link
Owner

Hey there @davep , thank you for the issue.

I took a look in some terminals that have it enabled couldn't find in kitty neither alacritty but terminal.app does have it. Would you mind list others that support it?

Screenshot 2023-08-31 at 12 57 24

@davep
Copy link
Author

davep commented Aug 31, 2023

Sorry, yeah, the wording wasn't great there (and for some reason I thought Alacritty did, but I'm misremembering). iTerm would be another but you're right that it isn't an overwhelming list.

I guess the more general question here is, would you entertain the idea of having something in the environment (either like terminal.app or iTerm, or something more like Alacritty or Kitty, with their window ID or PID environment variables) that identifies that rio is the terminal being used, and ideally the version too?

The motivation for this is I'm part of a team that works on a library for building terminal-based applications and often issues that developers run in to are related to terminal differences and glitches; so being able to identify the terminal in use from our environment diagnosis report makes it easier to get to the bottom of this.

Obviously not the most crucial of requests, but very convenient to getting to the bottom of issues.

@raphamorim
Copy link
Owner

I see, I don't really see a reason to don't implement it. Added changes in latest main please let me know if that work and I will close the issue.

Screenshot 2023-08-31 at 14 11 34

@davep
Copy link
Author

davep commented Aug 31, 2023

Perfect! Thanks. Our environment report now shows:

## Terminal

| Name                 | Value          |
|----------------------|----------------|
| Terminal Application | rio (0.0.18)   |
| TERM                 | xterm-256color |
| COLORTERM            | truecolor      |
| FORCE_COLOR          | *Not set*      |
| NO_COLOR             | *Not set*      |

Spot on. :-)

@raphamorim
Copy link
Owner

Great! Thank you for checking it

@nyabinary
Copy link

cc @raphamorim Just $TERM is very common as well.

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

No branches or pull requests

3 participants