ohmyzsh / ohmyzsh

🙃 A delightful community-driven (with 2,300+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.

Home Page:https://ohmyz.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Branch Switch Delay

DeeWBee opened this issue · comments

Describe the bug

With the latest OMZsh update, it appears there is a lag when switching branches (video attached for example).

Previous Versions: A repo or directory would be loaded on the correct branch "right away" (apologies for lack of technical terminology). No flickering/switching present.

New/current Version: A repo or directory is loaded on an incorrect branch, and flashes/switches to the expected branch after loading the directory. In the attached video, notice the se-commerce and sportsengine directories will briefly flash the previously loaded branch.

Steps to reproduce

  1. Load two repos within the same directory
  2. Ensure RepoA has branchA checked-out, and RepoB has branchB checked-out (repo names and branches are at testers discretion)
  3. Within terminal/CLI, navigate back-and-forth between RepoA and RepoB

Expected behavior

A repo or directory is loaded on the expected branch "right away" (without any delay or flickering between branches).

Screenshots and recordings

Screen.Recording.2024-04-23.at.9.48.20.AM.mov

OS / Linux distribution

MacOS Sonoma 14.4

Zsh version

5.9

Oh My Zsh version

master (5d2d35c)

Terminal emulator

Terminal.app

If using WSL on Windows, which version of WSL

None

Additional context

sportsengine is a monorepo and se-commerce is a repo/project within the larger monorepo.

Hi! That's expected with the new async way of getting git information. As you may feel, it's way faster to enter the directories, and you don't need to wait for git information to be ready.
It'd be straightforward to add an option that erases the information when changing directory and only prints it when it's ready. But the flickering will still be there (no temporary "wrong" information).
If you just want to have the same experience as before, you can disable git async, but you'll feel that changing directory is way slower.

Hi @carlosala! Disabling git async fixed my problem; I appreciate the quick response!

For what it's worth: on my machine and network (M2 Max w/64gb RAM) I don't notice any drops in performance with the feature enabled or disabled. I think I'll keep the feature disabled for the foreseeable future.