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

Set the working directory for commands with the cwd key #2281

Closed
w0rp opened this issue Feb 7, 2019 · 2 comments · Fixed by bergie/dotfiles#69
Closed

Set the working directory for commands with the cwd key #2281

w0rp opened this issue Feb 7, 2019 · 2 comments · Fixed by bergie/dotfiles#69

Comments

@w0rp
Copy link
Member

w0rp commented Feb 7, 2019

Related to #2256.

Vim patch 8.0.0902 adds an cwd key for setting the working directory for jobs, and NeoVim offers a similar option. We could set the working directory this way to make command lines shorter on Windows, provided we use a version check and fall back on editing the command in other cases.

@w0rp w0rp added this to To Do in Old Working List via automation May 1, 2019
@w0rp w0rp moved this from To Do to In Progress in Old Working List May 1, 2019
w0rp added a commit that referenced this issue May 23, 2019
@w0rp w0rp added this to In Progress in On the Radar Aug 17, 2019
@w0rp w0rp moved this from In Progress to To Do in On the Radar Feb 22, 2020
@w0rp
Copy link
Member Author

w0rp commented Feb 21, 2021

Having thought about this more, and considering functionality ALE supports for running commands with wrapper scripts and on other machines, such as inside a Docker image or in a VM, using the actual cwd keys for the job functions will provide less functionality than we already have, and we'll also need to provide fallbacks for older Vim versions we want to continue to support anyway.

However, splitting the working directory from the commands users specify and then putting the cd command at the front of the command we actually run has a lot of value, because it will allow us to swap out the working directory when running checks for entire projects. See #3599. I'll do that instead.

@w0rp w0rp closed this as completed in 9fe7b1f Mar 1, 2021
On the Radar automation moved this from To Do to Done Mar 1, 2021
@w0rp
Copy link
Member Author

w0rp commented Mar 1, 2021

I've implemented this now with my new idea. Keeping cd ... && in the command will make it easy to support changing directory inside of another machine in future with filename mapping. The next step is to implement a command for running ALE linters over an entire project.

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

Successfully merging a pull request may close this issue.

1 participant