5 ms·
Why dont we have mkcd in linux natively boggles my mind :)
by sid- 11mo ago
Why dont we have mkcd in linux natively boggles my mind :)
- taejavu 11mo agozsh has a `take` utility that is exactly this
- marcuskaz 11mo agoLikewise, why doesn't git clone automatically cd into the repo?
- andriamanitra 11mo agoA subprocess (git) can't modify the working directory of the parent process (the shell). This is a common annoyance with file managers like yazi and ranger as well—you need an extra (usually manual!) installation step to add a shell integration for whichever shell you're using so the shell itself can change directory. The best solution for automatically cd'ing into the repo is to wrap git clone in a shell function or alias. Unfortunately I don't think there's any way to make git clone print the path a repository was cloned to, so I had to do some hacky string processing that tries to handle the most common usage (ignore the "gh:" in the URL regex, my git config just expands it to "git@github.com:"): https://github.com/Andriamanitra/dotfiles/blob/d1aecb8c37f09bba0613f75056d379c2b055cca8/fish/.config/fish/functions/clo.fish https://github.com/Andriamanitra/dotfiles/blob/d1aecb8c37f09...