clink icon indicating copy to clipboard operation
clink copied to clipboard

Clink launches slowly and using custom prompt almost makes it unusable

Open shehzan10 opened this issue 5 years ago • 1 comments

The issue I'm seeing is that Clink launches slowly as described in #428. However, for a one time problem, I don't care that much (I would prefer it to be faster, but I can live with it).

The problem comes when using the git prompt for the branch (https://github.com/mridgers/clink/blob/0.4.9/docs/clink.md#customising-the-prompt). Basically, since Clink launches slowly, and I use autorun by default, calling io.popen in Lua launches a new Clink based prompt each time which makes the git branch command take like 30 seconds.

This is compounded by it taking 30 seconds after executing each command, and this making my command prompt basically unusable.

I see 2 solutions:

  1. Clink loads faster.
  2. Lua's io.popen should not load the clink-based prompt when inject by autorun default.

I know option 2 is probably not under the control of Clink, but maybe there is an open to run io.popen using powershell etc? I'm not a Lua user, so I don't know much about it.

I tried using Lua's os.execute, but that didn't work since we need the output string back.

shehzan10 avatar Oct 26 '18 15:10 shehzan10

Have you tried running SysInternals' ProcMon utility when launching clink? I wonder if that might show some file activity that's the problem - not finding a file and doing way too much searching, maybe in a very long PATH, for example. Thirty seconds seems way too long and I wonder what it's doing during that time.

rgd avatar Oct 28 '18 00:10 rgd