-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
enable starting hx with a working directory #8223
enable starting hx with a working directory #8223
Conversation
Ah I think I get this now the description is a bit confusing, so all you allow is also opening files in the background if opening a directory (which is already supported). That seems alright |
Yes, That is correct. This improves Also I can close this PR |
Using a regular parameter and making this order dependent seems wrong for me and potentially confusing for ens users. Why not just use a proper flag? |
Hi @archseer, it was mentioned in the matrix chat that the developers of Helix-Term are trying to avoid adding flags. You can see in a comment I made above that I mention closing a PR in favor of this PR, that PR does use a flag for setting the initial workspace directory. Either or both approaches is fine with me. |
On Matrix I was specifically talking about configuration flags that would be put in config.toml, not CLI flags. I'd prefer this be a flag rather than a parameter |
I think that was me that said we try not too add many command line options, I think based on some comments by mike in other issues, though from what I just read know those where about not having command line options that could be config options. From what I remember from matrix it seems like the reason for this was because there was use case where |
Okay, do we want to close this PR and reopen this PR with the |
Why not just update the current PR by force pushing? No need to open a PR each time the approach is changed, that way the conversation isn't fragmented |
Sure, that works. Let me make the updates. |
bbbbf8b
to
5f62202
Compare
add @variable.other.member query for keyed elements remove special case of all caps vars treated as const fixes helix-editor#8223
@pascalkuthe I updated the code on
Then I realized, If there are no files passed, then the -w flag would get completely ignored and no working directory would be set. This could be okay, but I think not an expected behavior from a normal user's perspective. For now, I have moved the code snippet above to This means that
Other options could be:
Let me know what you think. Hopefully this doesn't overly complicate things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think k the way you implemented it now makes sense and is quite simple. I prefer to keep the cli simple 👍
* added working path arg to cli and help menu * improve working path cli arg handling * enable hx to set the working path * applied cargo formatting * improved code from cargo clippy suggestion * improved code from follow up review * fix for -w <path> is set but args.files is empty * improved formatting of --help output
* added working path arg to cli and help menu * improve working path cli arg handling * enable hx to set the working path * applied cargo formatting * improved code from cargo clippy suggestion * improved code from follow up review * fix for -w <path> is set but args.files is empty * improved formatting of --help output
* added working path arg to cli and help menu * improve working path cli arg handling * enable hx to set the working path * applied cargo formatting * improved code from cargo clippy suggestion * improved code from follow up review * fix for -w <path> is set but args.files is empty * improved formatting of --help output
* added working path arg to cli and help menu * improve working path cli arg handling * enable hx to set the working path * applied cargo formatting * improved code from cargo clippy suggestion * improved code from follow up review * fix for -w <path> is set but args.files is empty * improved formatting of --help output
You can now use -w or --working-dir to set the current working directory of the hx editor from command line launch.
Similar to these other editors here
example:
hx -w <path> --log hx.log -- <files>...
hx --working-dir <path> --log hx.log -- <files>...
hx -w <path> --log hx.log
hx --log hx.log <path>
confirm it works by checking your current working directory from inside the editor with
:pwd
confirm the files are opened with
:bn