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

Add command cwd to working directory #5

Closed
3 tasks done
leakec opened this issue Nov 5, 2023 · 1 comment · Fixed by #6
Closed
3 tasks done

Add command cwd to working directory #5

leakec opened this issue Nov 5, 2023 · 1 comment · Fixed by #6
Assignees
Labels
enhancement New feature or request

Comments

@leakec
Copy link
Collaborator

leakec commented Nov 5, 2023

Problem

I want to be able to run commands from a specific directory rather than the zellij /host directory. However, as we will see, the solution creates some other problems, namely:

  • With the current setup, we can have multiple instances of the multitask plugin all pointing to the same file. When this file is changed, then all the plugin instances will run those commands from their specific cwd. This is undesirable.
  • Need to use launch-or-focus-plugin to reload the config each time. start-or-launch-plugin seems to always use the starting config.

Solution

  • This can be done by adding a cwd option to the configuration and running command using that cwd.
  • Change start-or-launch-plugin to launch-or-focus-plugin in the README.
  • Need to use something other than /host/.multitask as the multitask file, since each plugin instance needs its own .multitask file.
leakec added a commit that referenced this issue Nov 5, 2023
Also adding cwd=`pwd` so that multitask runs commands from the directory the launch was called from.
@leakec
Copy link
Collaborator Author

leakec commented Nov 5, 2023

We want to use something other than /host/.multitask. My first thought was something in /tmp, since this would also keep from cluttering up the /host folder. However, FileSystemUpdate, which is used to determine when the file is changed, only has access to the /host folder. Therefore, I think the best thing to do is create a unique .multitask file in the /host folder for each instance of the multitask plugin (there will be a unique instance for each one spawned with a different config). Luckily, we already have a unique identifier, which is the plugin ID. Therefore, I'll just append that to the name of the file, e.g., /host/.multitask1.

leakec added a commit that referenced this issue Nov 5, 2023
…nto conflicts between multiple instances in different cwds. See #5.
@leakec leakec self-assigned this Nov 5, 2023
@leakec leakec added the enhancement New feature or request label Nov 5, 2023
@leakec leakec linked a pull request Nov 5, 2023 that will close this issue
@leakec leakec closed this as completed in #6 Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant