-
Notifications
You must be signed in to change notification settings - Fork 493
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
Allow setting Fork behavior in ENV variable #2187
Comments
@fredizzimo so I started doing this but one confusing bit of this is... i thought forking was the default, however in |
That’s actually the arguments it passes to the forked process, which should not fork itself again… |
I started doing this thinking it would be simple but it's actually quite confusing given that app development isn't where my specialty lies 😅 This was my current version I was working on... /// Instead of spawning a child process and leaking it, be "blocking" and let the shell persist
/// as parent process
#[arg(long = "no-fork", env = "NEOVIDE_FORK", action = ArgAction::SetFalse, default_value = "1", value_parser = FalseyValueParser::new())]
pub no_fork: bool, But then I realized after that I'm not exactly sure how the I don't expect other ppl to do this for me just wanted to write some notes. I'll attempt to come back to this later I think when I have more brainpower |
For the app creation, maybe you need to install the bundle tool? neovide/.github/workflows/build.yml Lines 121 to 123 in ce0174a
|
Ok, this may be a dumb question but this is definitely like a "boolean hell"... /// Instead of spawning a child process and leaking it, be "blocking" and let the shell persist
/// as parent process
#[arg(long = "no-fork", env = "NEOVIDE_FORK", default_value = "1", value_parser = FalseyValueParser::new())]
pub no_fork: bool, This is the closest I can get, but its actually inverted behavior because:
Aside from this, it works perfectly. I thought this would be simple at first given it is just booleans, but after messing with this for some time it's almost like its not possible unless the env variable is renamed NO_FORK Am i missing something obvious? |
Take a look at how But fork should work the exact same way, both defaults to true, and supports turning it off. |
Ah i see, ok I will try that. I'm literally sitting here laughing out loud because I didn't imagine it can get so crazy with boolean values. "This doesnt seem so bad" <- famous last words |
That has happened to me many times, especially when you use things like Edit and some languages that needs a double negation to convert to a boolean |
ok.. that was a very humbling experience. I'm scared to put my code here as I feel absolutely stupid after that, and it might be embarrasing, but so far this behavior seems to work... I would have guessed so many odd "negations" were not required, but this was the only way I could get it to work. I also noticed errors saying
/// Instead of spawning a child process and leaking it, be "blocking" and let the shell persist
/// as parent process
#[arg(long = "fork", env = "NEOVIDE_FORK", action = ArgAction::SetTrue, default_value = "1", value_parser = FalseyValueParser::new())]
_fork: bool,
/// Instead of spawning a child process and leaking it, be "blocking" and let the shell persist
/// as parent process
#[arg(long = "no-fork", action = ArgAction::SetTrue, value_parser = FalseyValueParser::new())]
pub no_fork: bool, And down in the if !cmdline._fork {
cmdline.no_fork = true;
}
if cmdline._no_srgb {
cmdline.srgb = false;
}
if cmdline._no_vsync {
cmdline.vsync = false;
} 3 instances I tested:
|
I would change the main argument from |
OK awesome... im glad to see this is the right track then 😅 |
@MultisampledNight I dont know if you have a procedure for closing things but I think this one can go too |
You're right! Yeehaw! Closed by #2189! |
Is your feature request related to a problem? Please describe.
#2147
Will assist with the dock version of the application until default forking behavior is decided.
Describe the solution you'd like
Add
NEOVIDE_FORK=0/1
The text was updated successfully, but these errors were encountered: