oh-my-bash icon indicating copy to clipboard operation
oh-my-bash copied to clipboard

Improve performance of prompts (reduce subshells, etc.)

Open tomaszkyc opened this issue 2 years ago • 6 comments

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?

tomaszkyc avatar Jan 02 '22 21:01 tomaszkyc

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?

akinomyoga avatar Jan 02 '22 22:01 akinomyoga

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.

mkieczko96 avatar Jan 12 '22 10:01 mkieczko96

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.

akinomyoga avatar Jan 12 '22 10:01 akinomyoga

@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! 👍

tomaszkyc avatar Jan 13 '22 20:01 tomaszkyc

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

akinomyoga avatar Jan 13 '22 21:01 akinomyoga

anyone patch for this ?

conn-dev avatar Mar 19 '24 04:03 conn-dev