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

Allow for tasks to pull current open directory #16418

Open
1 task done
AarnavSin opened this issue Aug 17, 2024 · 2 comments
Open
1 task done

Allow for tasks to pull current open directory #16418

AarnavSin opened this issue Aug 17, 2024 · 2 comments
Labels
enhancement [core label] needs info / awaiting response Issue that needs more information from the user support User support (non-defect troubleshooting, documentation, etc) tasks

Comments

@AarnavSin
Copy link

Check for existing issues

  • Completed

Describe the feature

Currently, Zed Tasks only have a way to reference one set directory via cwd. However, in some use cases, having the ability to pull the current open directory in your Zed window for that particular task could be helpful. For example, I was writing a task to allow me to easily create and open a file inside the terminal using the following code:

#!/bin/bash

read -p "Enter filename: " filename
touch "$filename"
zed "$filename"

However, by default this file gets created in the project root directory and not the subfolder which is currently open. To my knowledge there's no way to tell it to create the file in the open subfolder. Even adding lines in the shell script to use pwd to at least pull the current terminal directory doesn't work correctly.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@AarnavSin AarnavSin added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Aug 17, 2024
@notpeter
Copy link
Member

notpeter commented Aug 23, 2024

We support Task Variables in task definitions.

Would ${ZED_DIRNAME} in cwd meet your needs?

ZED_DIRNAME: absolute path of the currently opened file with file name stripped (e.g. /Users/my-user/path/to/project/src)

@notpeter notpeter added tasks support User support (non-defect troubleshooting, documentation, etc) and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Aug 23, 2024
@ChaochaoCui
Copy link

+1

@Moshyfawn Moshyfawn added the needs info / awaiting response Issue that needs more information from the user label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] needs info / awaiting response Issue that needs more information from the user support User support (non-defect troubleshooting, documentation, etc) tasks
Projects
None yet
Development

No branches or pull requests

4 participants