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
update Clink version #2751
Comments
|
This looks like an oh-my-posh issue (not a Clink issue, and not a Cmder issue). Oh-my-posh binds a custom command to the Space key. The custom command invokes the oh-my-posh.exe program every time you press Space. The reason it binds a custom command to the Space key is so that it can change the right-side prompt depending on what command word has been typed. @JanDeDobbeleer The custom command needs to be more efficient. One cheap option could be to only invoke oh-my-posh when the command word changes; then there would usually only be a delay the first time Space is pressed. Another more sophisticated option could be to update the oh-my-posh Lua script to use Asynchronous Prompt Filtering. We can chat here, or you can send me an email to the address in my github profile and we can chat offline and post an update here later. |
|
@chrisant996 we already make use of async prompt filtering so that should be good. I also just created a change that will only enable this functionality when you've set custom tooltips (it was enabled all the time). Can you point me to the docs on command word changes? But still, the issue stands. The version needs to be updated :-) |
|
@andi-blafasl With recent versions of OMP, I do not see the reported behavior. There is a delay, but only when initially showing the prompt, and when Space is pressed the first time.
@JanDeDobbeleer I looked at OMP v10.0.1 and it uses a coroutine for the right side prompt, but it doesn't use Clink's Asynchronous Prompt Filtering support. On my fast gaming laptop, OMP uses ~260 ms in a non-git directory, and ~340 ms in a relatively small git repo with no modified files. OMP can achieve 0-2 ms if it uses Clink's Async Prompt Filtering support. Some observations for the OMP init script:
For OMP to fully utilize Clink's async prompt filtering and be the most responsive, OMP would need to communicate with itself about the previous values it used for "expensive" operations, and then reuse those values for the initial synchronous spawn of OMP, and trigger an async spawn of OMP to recalculate updated values for the "expensive" operations. For Clink v1.3.43, I've added diagnostic output in Clink to report costs for prompt filters (Alt-1,Ctrl-X,Ctrl-Z). Here is OMP in a plain non-git directory with the jandedobbeleer.omp.json theme. I included flexprompt costs, pasted in from a separate run, for convenience. Here is OMP in the clink git repo (which is relatively small, and has no files modified right now). Again I included flexprompt costs, pasted in from a separate run, for convenience. |
|
@chrisant996 thanks. Seems like I have some studying to do. But this part is a no go architecturally:
These are only expensive on Windows btw, not kidding either. Git is significantly slower on Windows (also for the oh-my-posh repo). |
@JanDeDobbeleer In that case, there are three basic categories of options:
My recommendation would be option 3 if responsiveness is considered more important than initial accuracy after e.g. changing the current working directory. OMP is mostly already avoiding concurrent instances, so the benefit of option 2 seems relatively low by itself, unless/until reports come in about extra OMP instances running concurrently (there are edge cases that can happen, e.g. when pressing Enter and |
|
@chrisant996 I'll first need to get clink to work on my ARM VM. For some reason it simply refuses to load. Probably pebcak... |
|
There's no ARM version of Clink. You'll have to start the x64 or x86 cmd.exe in order to be able to inject Clink. |
|
P.S. @JanDeDobbeleer let me know if you want me to take a stab at option 3. |
Tried that, must've done something wrong. @chrisant996 yes, if you want to you can give it a go. |
@chrisant996 Just saw there is Version 10.2.0 available with winget. Here is an updated debug output: BTW: A college at my company is also experiencing the slow startup and the long waiting time between two prompts (by just hitting enter). We both installed OMP on our private Systems at Home and there is nearly no delay between two prompts and the runtime in the debug is also very small. Don't have the exact numbers right now, sorry |
|
I know from experience here with Cmder that business machines can be an issue that is hard to crack. That could be a tough one. |
|
If the business machines let you add exceptions to the antivirus/anti-malware suite, try adding exceptions for oh-my-posh and git (use task manager or etc to figure out which executables are taking a long time to run, and add exceptions for them). If not ... then you're probably stuck with the delays. |
|
@chrisant996 I already made an exception for the oh-my-posh executable. The delay was reduced, the exception works. But now even if I disable the Antivirus on my machine completely, there is no difference in timing. |
|
@andi-blafasl which timing, where, for how long? Try to use task manager or etc to figure out which executables are taking a long time to run, and add exceptions for them. oh-my-posh.exe is only one of multiple executables that may be running. You'll have to dig into this a bit and examine what's happening on the machine. |
@JanDeDobbeleer I have some proposed changes, and maybe some bug fixes. I'll put together a PR sometime this coming week. Short version -- omp is now highly responsive except in two cases:
|
|
PR is available at JanDeDobbeleer/oh-my-posh#2951. Sorry for the delay ... I plain forgot about it. |
|
@chrisant996 we're only human. And busy enough already |
|
This may be a dumb question but what does Clink have to do with OMP since Clink is a shell enhancement for Cmd and not Powershell? I think I am missing something. Thanks in advance. |
|
@daxgames oh-my-posh can run in any shell as of the last 2 years. I guess that's the context you're missing. |
|
OMP supports Clink now, and for each shell OMP has a different built-in custom script for integrating with the shell. We've been working on optimizing OMP in Clink so that it doesn't cause lags/pauses. This issue (2751) is at its root about OMP, moreso than either Cmder or Clink. But the OP observed that a newer Clink made the delays a little shorter, so the OP requested Cmder to update to a newer Clink. However, the main issue was that a newer version of OMP needed to be used. Along the way Jan and I found some additional ways to improve OMP. |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment


andi-blafasl commentedSep 23, 2022
Purpose of the issue
Version Information
Cmder 1.3.19.1181
Clink provide with Cmder 1.2.46
Clink latest 1.3.42.ef446e
Windows Terminal 1.15.2524.0 (but problem also appears in conemu)
Windows 10 Version 21H1 (Build 19043.2006)
Description of the issue
I'm trying to get oh-my-posh running but with the embedded Clink the input is horrible slow:

yes, this is real time copy-past ;-)
with the latest clink version it is a little bit better:

The text was updated successfully, but these errors were encountered: