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

Shell commands no longer run from the current repository directory #3872

Closed
peppy opened this issue Aug 29, 2024 · 6 comments
Closed

Shell commands no longer run from the current repository directory #3872

peppy opened this issue Aug 29, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@peppy
Copy link

peppy commented Aug 29, 2024

Regressed at some point, used to work. Testing on current HEAD (05ae080)

iTerm 2024-08-29 at 05 01 04

@peppy peppy added the bug Something isn't working label Aug 29, 2024
@stefanhaller
Copy link
Collaborator

Can't reproduce, seems to work correctly for me. Could you provide more detail? From which directory are you starting lazygit, and what is the path to your repo? This is hard to see from the video.

@peppy
Copy link
Author

peppy commented Aug 29, 2024

Sorry, here's a more clear video:

iTerm.2024-08-29.at.10.41.35.mp4

I'm starting lazygit from ~/Projects and the repo here is ~/Projects/osu.

May be something to do with my shell being fish, but it did work until recently and I don't believe I've changed anything at my end.

@stefanhaller
Copy link
Collaborator

It's probably caused by #3793 then. Does your config.fish cd to ~/Projects? That would explain it.

@peppy
Copy link
Author

peppy commented Aug 29, 2024

Yes, it does 😅, sorry I forgot that's how I had things setup:

if status is-interactive
    cd ~/Projects
end

I wonder if I can implement a solution in my config in that case.

@stefanhaller
Copy link
Collaborator

We have no way to customize the shell that is being used for custom commands. We were hoping that calling $SHELL -i would always work well, but here's one case where it doesn't.

One potential workaround could be if lazygit would set an environment variable (e.g. LAZYGIT_CUSTOM_COMMAND=1 or some such) which you could then check in your config file.

But my recommendation would be to remove it from your config file, and instead configure your terminal so that it cds to Projects when you open a new tab. Most terminals have such an option, I think.

@peppy
Copy link
Author

peppy commented Aug 29, 2024

I think the reason I set it up this way was for ssh sessions to also get the correct default directory. But I seldom use that so I will take your advice for now.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants