ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.53k stars 624 forks source link

problems with cd on sshfs mounted directory with git repositories #531

Open laurapoggio-sptools opened 4 months ago

laurapoggio-sptools commented 4 months ago

I am testing oh-my-bash. Great tool. I tried to cd into a git repository in a folder mounted via sshfs. The console hanged. It is working without problems is I do not use oh-my-bash

I found this issue.

Especially this comment and the following one.

Any recommended solutions (beside running git config oh-my-bash.hide-status 1 in each subdirectory)?

akinomyoga commented 4 months ago

There is currently no recommended general solution.

If you are fine without git status at all, maybe you can configure it globally: git config --global bash-it.hide-status 1.

Or you can overwrite the shell function _omb_prompt_git with something like the following, (though I haven't tested it):

# bashrc (after source "$OSH"/oh-my-bash.sh)

function _omb_prompt_git {
  local fstype=$(df -T . | awk '{T=$2}END{print $2}')
  [[ $fstype == fuse.sshfs ]] && return 1
  command git "$@"
}
laurapoggio-sptools commented 4 months ago

Setting the git config works.

I like the idea of the function, but I have not been able to make it work. I will test with the hide-status and see if it gives any issues.