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

Branch Switch Delay #12378

Closed
DeeWBee opened this issue Apr 23, 2024 · 2 comments
Closed

Branch Switch Delay #12378

DeeWBee opened this issue Apr 23, 2024 · 2 comments
Assignees
Labels
Bug Something isn't working

Comments

@DeeWBee
Copy link

DeeWBee commented Apr 23, 2024

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.

@DeeWBee DeeWBee added the Bug Something isn't working label Apr 23, 2024
@carlosala
Copy link
Member

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.

@carlosala carlosala self-assigned this Apr 24, 2024
@DeeWBee
Copy link
Author

DeeWBee commented Apr 30, 2024

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.

@DeeWBee DeeWBee closed this as completed Apr 30, 2024
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
Status: Done
Development

No branches or pull requests

2 participants