-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
p10k-like instant prompt #5310
Comments
@TheColorman this isn't practically possible as unlike p10k, we're not running directly in the shell. There's no way to return a string at the same time as processing long commands in the background. Additionally, even if, we would need to render the entire prompt again as conditional colors and segment chaining depends on all active segments, you can't stitch something in between. You also need a way to report back as how can oh-my-posh let the shell know it's done processing to reload the prompt, that's quite the challenge (not sure if this can be solved even due to it not being shell native). You can set up fast loading on PowerShell by wrapping the |
That makes sense, guess there's no good solution for asynchronous segments like last.fm for now then. I'm not that familiar with go (or shell plugins/renderers for that matter), so I wasn't quite sure how omp works under the hood. I don't use PowerShell myself (I'm on zsh), but I'll keep it in mind if I ever need to, because I really like omp! I guess that closes the issue then? |
@TheColorman what if we create a feature that allows you to define an instant prompt (like transient) and we load that one fast, then asynchronously create the actual prompt and replace when done? |
If that's possible that would definitely fit any of my use cases. Something like the configuration for the transient prompt, but for an instant prompt? |
i switched from p10k and miss instantprompt :D |
same here, for example open new TMUX session and do some
without an instant prompt, the So an adding a kind of instant prompt would be much appreciated. |
As @JanDeDobbeleer mentioned in #5524 these additional settings:
solves my issue with not loaded commands. |
I was so happy to find @feekApp Where did you set these settings? |
@isapir first lines of my .toml file
|
Thanks @feekApp. I'm not sure that I see a difference but I'll give it a try (first 5 runs are with this config and the last 5 runs are with default): |
Code of Conduct
What would you like to see added?
Some segments can take a long time to load, such as the Last.fm music segment, as it has to complete an http request, or segments that run custom shell commands/scripts. This can slow down the load time considerably.
powerlevel10k
has a feature called "instant shell" that allows you to start typing your command while different zsh plugins load.A similar feature that allows you to type immediately, then loads each segment independently would go a long way to make the shell feel a lot faster. With the Last.fm example, every segment would practically load instantly, allowing you to start typing, only for the Last.fm segment to appear whenever it is ready.
#2861 suggests a similar feature for PowerShell, but the feasibility of the implementation was never discussed.
The text was updated successfully, but these errors were encountered: