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(settings): fix #2012 exceptions thrown by non-unicode environment variables #2013

Closed
wants to merge 2 commits into from

Conversation

StringKe
Copy link

@StringKe StringKe commented May 10, 2024

fix #2012 an exception caused by the presence of non-unicode environment variables.

scope: atuin-client
changes:

  1. add get_env_var in utils.rs
  2. change load env in settings.rs

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

… environment variables.

scope: atuin-client
changes:
1. add get_env_var in utils.rs
2. change load env in settings.rs
#[test]
fn test_get_env_var_existing() {
// Set an environment variable for the purpose of this test.
env::set_var("TEST_ENV_VAR", "123");
Copy link
Member

Choose a reason for hiding this comment

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

I suspect this may cause issues in tests, but let's see

Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

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

Thank you! This looks good to me, is there a reason it's still a draft?

@akinomyoga
Copy link
Contributor

akinomyoga commented May 13, 2024

I think the problem isn't fixed. I cherry-picked the fixes in this PR, but the behavior for a=$'\x80' atuin search isn't fixed. The issue is that the problematic std::env::vars() is called inside crate config.

https://github.com/mehcode/config-rs/blob/e3c1d0b452639478662a44f15ef6d5b6d969bf9b/src/env.rs#L323

@StringKe
Copy link
Author

Thank you! This looks good to me, is there a reason it's still a draft?

I'm not very good at rustlang, so my pr may be problematic.

Please feel free to drop this pr if there is a better solution.

@ellie
Copy link
Member

ellie commented May 13, 2024

@akinomyoga is right, I read this too soon after waking up, sorry! 🤦‍♀️

We could make a PR to the crate, but it looks like it's currently looking for maintainers. I don't mind running against a fork for now

@ellie
Copy link
Member

ellie commented May 13, 2024

See: #2016

@ellie ellie closed this May 13, 2024
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.

[Bug]: Chinese input methods cause errors when entering Chinese content in the Webstorm terminal.
3 participants