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

Terminal: cwd default use $HOME #15969

Open
1 task done
d1y opened this issue Aug 8, 2024 · 4 comments
Open
1 task done

Terminal: cwd default use $HOME #15969

d1y opened this issue Aug 8, 2024 · 4 comments
Labels
setting Feedback for preferences, configuration, etc support User support (non-defect troubleshooting, documentation, etc)

Comments

@d1y
Copy link
Contributor

d1y commented Aug 8, 2024

Check for existing issues

  • Completed

Describe the feature

I want the terminal to open the $HOME directory by default
The current behavior is to open by default /

Screen.Recording.2024-08-08.at.18.13.09.mov

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

No response

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

notpeter commented Aug 8, 2024

Can you try adding this to your Terminal settings block?:

    "working_directory": "always_home"

See: https://zed.dev/docs/configuring-zed#working-directory

@notpeter notpeter added setting Feedback for preferences, configuration, etc support User support (non-defect troubleshooting, documentation, etc) and removed enhancement [core label] triage Maintainer needs to classify the issue admin read Pending admin review labels Aug 8, 2024
@d1y
Copy link
Contributor Author

d1y commented Aug 11, 2024

Can you try adding this to your Terminal settings block?:

    "working_directory": "always_home"

See: zed.dev/docs/configuring-zed#working-directory

Why is my $HOME always for /

Screen.Recording.2024-08-11.at.13.05.50.mov

@diegodorado
Copy link

happens to me too, it isn't clear what does it mean "home, if we can find it", how is home being retrieved?

@accidentaldevelopment
Copy link

I ran into this too, and I think I've tracked it down. The working_directory setting goes through some processing, and then eventually gets passed through to the alacritty_terminal crate to actually handle the terminal.

I don't see specific documentation around this functionality, but this comment on an unrelated alacritty issue suggests that the default is the directory of the foreground process. If zed is run from /Applications the running directory would be /, so that explains why terminals open at root.

Zed's various working_directory options all fall back to the default (None). I think the solution is for Zed to attempt to replace the default with the user's home directory (while still falling back to None), rather than rely on alacritty to do that if the default is passed in. If Alacritty ever changes their default, it will disrupt Zed functionality as well.

I have an idea how to fix it; I'll put a PR up sometime tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
setting Feedback for preferences, configuration, etc support User support (non-defect troubleshooting, documentation, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants