Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I liked zsh a lot until I found that it would take a long time to cd into certain directories, I think they were ones with large git repositories. Maybe there's some way to shut that off but I went back to bash where I could be sure things would be responsive.


Were you using oh-my-zsh?

I have a few patches that speed up its git plugin by letting you opt-out of expensive operations. https://github.com/davvid/oh-my-zsh/commits/davvid

Last I checked, oh-my-zsh was in transition to a new version(?), and the pull requests have generally been ignored because of this.


Yes, I was using oh-my-zsh. I'd like to try it again if it's easy to make it non-slow.


Some of the secret details are in my theme: https://github.com/davvid/oh-my-zsh/blob/davvid/themes/davvi...

    ZSH_THEME_GIT_PROMPT_DIRTY=""
    ZSH_THEME_GIT_PROMPT_CLEAN=""
which lets it avoid expensive checks that my prompt doesn't need (it already shows that info elsewhere).

The real big win is that I export `POST_1_7_2_GIT=1` in `~/.zshrc` and the tweaks I made teach the git plugin to use `--ignore-submodule=dirty` when calling `git status`, which makes a huge difference.

I haven't caught up with oh-my-zsh in a bit; if there's a good place for me to rebase onto and do a new pull request I will. Does anybody know who the real oh-my-zsh maintainer is these days?


Same problem here. I think this is based on git plugin, since it displays current branch when you cd into directory. You can try disable that plugin.


One thing I have noticed is a delay in tab completion with the `git checkout` command.

In my plain gnome-terminal with git it would instantly autocomplete when I pressed tab.


> Maybe there's some way to shut that off

Not using oh-my-zsh or the like, zsh has lots of hooks and omz uses a lot of this hooks for or around git repos, so CD-ing into a git repo entails loads of work.

Use vanilla zsh and configure as needed, and it'll be as zippy as everywhere else.


Some of the plugins included in contrib, as well as really feature heavy pre-made configs like oh-my-zsh can slow things down. They're good to use as a starting point, but you can make the features you actually want really fast with some research.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: