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.59k stars 628 forks source link

Improve performance of prompts (reduce subshells, etc.) #281

Open tomaszkyc opened 2 years ago

tomaszkyc commented 2 years ago

Hi everybody!

I'm new one to the oh-my-bash on my mac. I see that installed oh-my-bash + agnoster theme has some input lag for every command that I try (even simple ls -la have some small lag).

Do you have the same issue? Do you know any workaround for that?

akinomyoga commented 2 years ago

There are many possible causes of the delay. Could you describe it in more detail? What exactly do you mean by the input delay? Would you experience the delay between every keystroke? For example, in the case of ls -la, do you experience the delay while inputting the characters ls -la? Or do you experience the delay after you press Enter before the command ls starts? Or do you experience the delay after the result of ls is shown before the next prompt is shown?

mkieczko96 commented 2 years ago

I have probably the same issue. Delay appers after pressing [Enter] key. Eg. while running cd some-dir/ command I get pwd printed and then it takes some time to print a new prompt line.

akinomyoga commented 2 years ago

Thank you for the information. OK, this means that it takes time to generate the prompt contents. I think the delay should become longer in git repositories as reported in #6, #172, and #270, but there is also a delay outside the git repositories because of many forks/execs caused by subshells and external program executions. It would be actually a large rewrite of the entire codebase to minimize the number of forks/execs, so it won't be resolved soon, yet I'll consider it in the future.

tomaszkyc commented 2 years ago

@akinomyoga sorry for late response but I have the same feelings like @mkieczko96. So I guess that now everything is clear and we can close the issue. Really appreciate your willing to help! 👍

akinomyoga commented 2 years ago

Thank you! But I'd like to consider it in the future anyway, so let us keep this open.

conn-dev commented 4 months ago

anyone patch for this ?