Skip to content
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

Starting commands from Far Manger command line in ConEmu is very slow #1838

Open
MishaKharaba opened this issue Feb 27, 2019 · 42 comments
Open

Starting commands from Far Manger command line in ConEmu is very slow #1838

MishaKharaba opened this issue Feb 27, 2019 · 42 comments
Milestone

Comments

@MishaKharaba
Copy link

@MishaKharaba MishaKharaba commented Feb 27, 2019

ConEmu x64 190225, Far 3.0.5225 x64

I run FarManager in ConEmu window.
From Far command line I start command:
cd C:\ or cd D:\ or just dir - it does not matter

After pressing ENTER it takes 2-3 seconds to start command

When Far is running standalone without ConEmu the commands starts immediately.

Reinstalling ComEnu with default settings did help

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Feb 27, 2019

So, do you observe the problem now or not?

Loading

@bitraid
Copy link

@bitraid bitraid commented Feb 27, 2019

I've experienced the same issue lately, but i haven't found the time yet to check which setting causes the dealy.

Loading

@bitraid
Copy link

@bitraid bitraid commented Mar 2, 2019

For me the delay happens if far is started with the -w switch (outside ConEmu there is no delay).

Loading

@bitraid
Copy link

@bitraid bitraid commented Mar 2, 2019

I also noticed that the delay is much less if the ConEmu far plugins are not installed.

Loading

@bitraid
Copy link

@bitraid bitraid commented Mar 2, 2019

After testing on different machines i noticed that the delay is very small (barely noticeable) on a fast system but really shows on slower VMs.

Loading

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 2, 2019

Try to disable Long console output

Loading

@bitraid
Copy link

@bitraid bitraid commented Mar 2, 2019

Yes that's much better, thanks.

Loading

@MishaKharaba
Copy link
Author

@MishaKharaba MishaKharaba commented Mar 12, 2019

So, do you observe the problem now or not?

I still have an issue on my work machine. But on virtual machine (win server 2016 ) it works well.

If there are some debugging options with adtitional logging, I can run it on my work machine and send you log file.

Loading

@industrious
Copy link

@industrious industrious commented Mar 13, 2019

I see the same problem on my work computer too. Disabling long console output does not help. No such a problem when Far is running standalone.
Far 3.0.5254 ConEmu 190310
Windows 10 (version 1809)

Loading

@industrious
Copy link

@industrious industrious commented Mar 13, 2019

I see the same problem on my work computer too. Disabling long console output does not help. No such a problem when Far is running standalone.
Far 3.0.5254 ConEmu 190310
Windows 10 (version 1809)

Ok, I guess it was related to long console output after all.

Loading

@lllcky
Copy link

@lllcky lllcky commented Mar 24, 2019

There is the same issue for me. But on ConEmu x86 the delay of command execution is little shorter than on x64 version. Any solution?
ConEmu version 190310 preview

Loading

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 25, 2019

But on ConEmu x86 the delay of command execution is little shorter than on x64 version.

Unbelievable... The delay depends only on "long console output" and actual height of the buffer.
Note that expected delay depends after command execution. At that moment ConEmuC (bitness doesn't depend on ConEmu bitness) reads output of the command.
There is no other way to eliminate the delay except disable "long console output".

Loading

@target-san
Copy link

@target-san target-san commented Mar 26, 2019

Just my 5 cents. Delay happens only if FAR runs in ConEMU. If either FAR runs in CMD or ConEMU runs cmd, there's no delay. Delay happens both before and after command execution.

ConEmu 190324 x64
FAR 3.0b5354 x64
Win 10 1809 x64

Loading

@MishaKharaba
Copy link
Author

@MishaKharaba MishaKharaba commented Mar 26, 2019

Just now I have updated ConEmu to the last version and reset setting to default.
In my situation option "long console output" does not change anything.
Btw, delay is before command execution

Loading

@Maximus5 Maximus5 added this to To Do in Inspection via automation Mar 26, 2019
@Maximus5 Maximus5 added this to To Do in Far via automation Mar 26, 2019
@BOOtak
Copy link

@BOOtak BOOtak commented Mar 27, 2019

I can confirm that issue. I don't need to execute any command inside Far to experience the delay, even pressing Enter in Far causes it. Disabling long console output does not seem to help.

I noticed that during the delay, conhost.exe eats the whole CPU core (see image attached)

image

Also, if I launch Far in Cmder (which is based on ConEmu, I suppose), it works just fine and I don't experience any delays in Far.

Also, Far works just fine in ConEmu on Windows 7, and it did work fine on previous updates of Windows 10 (unfortunately, I don't recall the last Windows 10 build number where Far worked fine inside ConEmu)

Windows 10 x64 ver 10.0.17763.107
Far Manager, version 3.0 (build 4774) x64
ConEmu 190324 preview

Loading

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 27, 2019

if I launch Far in Cmder (which is based on ConEmu, I suppose), it works just fine and I don't experience any delays in Far.

That can't be. Cmder is ConEmu. So the problem is with your settings only!

I need Log Files from the fresh 190326 build.

Run ConEmu64.exe -basic -log -run {far} and do the repro.

Loading

@BOOtak
Copy link

@BOOtak BOOtak commented Mar 27, 2019

@Maximus5

So the problem is with your settings only!

OK, this sounds promising! I hope we figure out what these settings are.

Run ConEmu64.exe -basic -log -run {far} and do the repro.

Done:
ConEmuLogs.zip

Loading

@MishaKharaba
Copy link
Author

@MishaKharaba MishaKharaba commented Mar 27, 2019

My logs
ConEmuLogs.zip

I have run twice cd c:\ and cd d:\
Delay was exactly after pressing Enter and before starting command.
It looked like a smal freeze after Enter for 1-2 sec

Loading

@lllcky
Copy link

@lllcky lllcky commented Mar 28, 2019

There is a demonstration of logs collections and the issue
(video) https://radikal.ru/video/gWmqZTzoyDJ

These logs: ConEmu-srv-5396.zip

Loading

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Mar 31, 2019

I've updated logging. Please install build 190331 and redo logs.

Loading

@Maximus5 Maximus5 added this to the 190401 milestone Mar 31, 2019
@BOOtak
Copy link

@BOOtak BOOtak commented Apr 1, 2019

Loading

@DamianFekete
Copy link

@DamianFekete DamianFekete commented Apr 8, 2019

I've created the logs with -log5. I've changed directory (cd folder) at 11:26:30.
2019-04-08-conemu.zip

11:26:30.481 WM_KEYDOWN ""  wParam=x0000000D, lParam=x011C0001
11:26:30.481 WM_CHAR "\r" wParam=x0000000D, lParam=x011C0001
11:26:30.481   (\x000D) Down, count=1, VK=13, SC=28, CH=13, State=0x00000120 <Enhanced>
11:26:30.484 [14048] Invalidating from CRealConsole::MonitorThread.1
11:26:30.484 [13728] CConEmuChild::OnPaint
11:26:30.484 [13728] Blitting to Display
11:26:30.641 WM_KEYUP   ""  wParam=x0000000D, lParam=xC11C0001
11:26:30.641   (\x000D) Up,   count=1, VK=13, SC=28, CH=13, State=0x00000120 <Enhanced>
11:26:31.016 [14048] Invalidating from CRealConsole::MonitorThread.1
11:26:31.016 [13728] CConEmuChild::OnPaint
11:26:31.016 [13728] Blitting to Display

11:26:31.230 MainThread Far.exe: Start command execution? buffer={80x32766} rect={0,32741}-{79,32765}
11:26:31.977 MainThread Far.exe: Start command execution? buffer={80x32766} rect={0,32741}-{79,32765}
11:26:31.989 RefrThread CurSize={80,25,32766} Cursor={13,32764,15%V} ConRect={0,32741}-{79,32765} :ReadConsoleInfo (skipped=1) {1:1:x520:0} {(0,0) (273x164)} `Lucida Console` 5x3 [begin]
11:26:31.989 RefrThread CurSize={80,25,32766} Cursor={13,32764,15%V} ConRect={0,32741}-{79,32765} :ReadConsoleInfo (skipped=1) {1:1:x520:0} {(0 [end]
11:26:31.990 RefrThread ReadConsoleData: content was changed

11:26:31.992 [14048] ApplyConsoleInfo: ScreenBufferInfo changed
11:26:31.992 [14048] ApplyConsoleInfo: Console contents received
11:26:31.992 [14048] DataCmp was changed, width=80, height=25, count=2000, posY=0, posX=53
11:26:31.992 [14048] ApplyConsoleInfo: InitBuffers&LoadDataFromSrv -> changed
11:26:31.996 [14048] mp_VCon->Update from CRealConsole::MonitorThread
11:26:31.996 [14048] Invalidating from CVirtualConsole::Update.1
11:26:31.996 [13728] CConEmuChild::OnPaint
11:26:31.998 [13728] Blitting to Display
11:26:32.006 [14048] ApplyConsoleInfo: Console contents received
11:26:32.006 [14048] mp_VCon->Update from CRealConsole::MonitorThread
11:26:32.006 [14048] Invalidating from CVirtualConsole::Update.1
11:26:32.006 [13728] CConEmuChild::OnPaint
11:26:32.006 [13728] Blitting to Display

11:26:35.677 RefrThread ReadConsoleData: content was changed
11:26:35.982 RefrThread ReadConsoleData: content was changed
11:26:36.013 MainThread Far.exe: SetConsoleMode(x00000008, x000001B7)
11:26:36.016 RefrThread Mode ConInMode changed: old=x01B8 new=x01B7

Loading

@bitraid
Copy link

@bitraid bitraid commented Apr 9, 2019

I've just tested the same ConEmu+Far setup on two virtual machines with identical hardware (and on the same host), one running Windows 10 v1607, and the other Windows 10 v1809. The one running v1809 was considerably slower.

Loading

@mmozeiko
Copy link

@mmozeiko mmozeiko commented Apr 28, 2019

I'm also seeing super annoying 1 to 2 second delay every time I run any command-line command from inside FarManager. If I run commands from cmd.exe with ConEmu - no delay. If I commands from FarManager without ConEmu - no delay.

Disabling "Long console output" does not change anything.

Here are my logs with default ConEmu configuration: ConEmuLogs.zip
I've run "cd \" and two "dir".

This is with:

  • FarManager 3.0 build 5391 x64
  • ConEmu x64 190331
  • Windows 10 Version 1809 (17763.437)

Loading

@mmozeiko
Copy link

@mmozeiko mmozeiko commented Apr 29, 2019

I tried installing older ConEmu releases as I remember that this behavior was not happening before.
What I found that if I install v17.09.10 version then commands run instantly in Far - same as in plain cmd.exe under ConEmu. But if I install next release v17.10.25 then the delay is back when running Far.

To test delay I launched ConEmu64.exe -basic -run {far} and then simply typed dir + enter. With v17.09.10 there is no delay, with v17.10.25 there is 1-2 second delay for me 100% of time.

I guess this means that change which introduced this delay is somewhere in these commits: v17.09.10...v17.10.25

For now I'll stick with v17.09.10 release.

Loading

@man4j
Copy link

@man4j man4j commented Jul 8, 2019

Any progress?

Loading

@huettenhain
Copy link

@huettenhain huettenhain commented Jul 11, 2019

I am also experiencing this issue on recent versions of Windows 10, but the issue is not present on my Windows 2008 Server machines and not on any Windows 7 VM that I run. Also, as mentioned before, the problem does not occur when running FAR outside of ConEmu.

Sadly, the following things did not help:

  • disabling long console output
  • switching to the 17.09.10 release
  • reinstalling ConEmu
  • deleting ConEmu.xml, resetting all settings to default

Loading

@huettenhain
Copy link

@huettenhain huettenhain commented Aug 5, 2019

A small update: For me, the problem has completely vanished on the Windows 10 machine after upgrading to version 1903, build 18362.267.

Loading

@mmozeiko
Copy link

@mmozeiko mmozeiko commented Aug 6, 2019

Can confirm. No delay anymore for me with following versions:
Windows 10 v1903
FarManager v3.0.0.5444
ConEmu v190714

Loading

@JPdotS
Copy link

@JPdotS JPdotS commented Sep 17, 2019

Do we know the root cause for this issue. I have this issue and do not have the opportunity to upgrade my Windows yet

Loading

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Sep 17, 2019

Perhaps it depends on some antivirus checks. I'm not sure because haven't seen that on my PC.

May you run "ConEmu64.exe -log" and reproduce the delay? I'm interested in LogFiles.

Loading

@mmozeiko
Copy link

@mmozeiko mmozeiko commented Sep 18, 2019

I'm pretty sure it is not an antivirus. I am not running any (even Windows Defender is off) and I still had these slowdowns. You can get my logfiles in my comment above (from Apr 28).

Loading

@target-san
Copy link

@target-san target-san commented Sep 18, 2019

It's definitely not AV.
I had those freezes started with 1809 and self-fixed on 1903.
Corp laptop, with Symantec, controlled by group policies.

Loading

@JPdotS
Copy link

@JPdotS JPdotS commented Sep 19, 2019

Far in itself is working fine, it is only when I run it through ConEmu I see the issue.
@Maximus5, I ran it with logs and did not see anything interesting in gui or con logs, but in srv logs, I do see the delay.

I see 4 seconds delay before execution starts in Far.

PS the command I ran was cd ..

The log:

12:50:25.945 ServThread CECMD_ONACTIVATION received, state update pending
12:50:25.947 RefrThread LoadGuiSettings(Changed) [begin]
12:50:25.947 RefrThread LoadGuiSettings(Changed) [end]
12:50:25.947 RefrThread bNewActive changed to true
12:50:25.947 RefrThread bNewFellInSleep changed to false
12:50:25.947 RefrThread ConEmuC: RefreshThread: Sleep changed, speed(high)
12:50:30.633 MainThread Far.exe: Start command execution? buffer={239x32766} rect={0,32703}-{238,32765}
12:50:33.748 MainThread Far.exe: Start command execution? buffer={239x32766} rect={0,32703}-{238,32765}
12:50:33.762 RefrThread CurSize={239,63,32766} Cursor={7,32764,15%V} ConRect={0,32703}-{238,32765} :ReadConsoleInfo (skipped=0) {1:1:x604:0} {(0,0) (750x354)} `Lucida Console` 5x3 [begin]
12:50:33.762 RefrThread CurSize={239,63,32766} Cursor={7,32764,15%V} ConRect={0,32703}-{238,32765} :ReadConsoleInfo (skipped=0) {1:1:x604:0} {( [end]
12:50:33.765 RefrThread ReadConsoleData: content was changed

I really can't understand why the delay

Loading

@JPdotS
Copy link

@JPdotS JPdotS commented Sep 19, 2019

@Maximus5, I found this issue very similar to mine
https://github.com/Maximus5/ConEmu/issues/350

With the recommendation to use https://conemu.github.io/blog/2015/10/06/Build-151006.html

I decided to give it a try.

Following finding is very intriguing

when I use the PortableApp and launch Far from within it, I do not see the degradation in performance, while when I tried to install the same version or use the portable version, I have the performance issue.

can you think of what could be the reason

Loading

@axfelix
Copy link

@axfelix axfelix commented Sep 20, 2019

I'm on Windows 10 18917.1 (I switched to Fast ring to get some packages redeployed to fix an issue I was having with the Store and now waiting for Slow to catch up, that Fast build is now a couple months old) and have been experiencing this issue since 1903, really hoping for a fix still.

Loading

@chengxuncc
Copy link

@chengxuncc chengxuncc commented Nov 27, 2019

Probably same problem here, Starting root process... takes about 2 seconds.

Loading

@khabibr
Copy link

@khabibr khabibr commented Jan 22, 2020

Same problem:
Starting root process... takes about 3 seconds in VirtualBox VM with Windows 10 LTSC 1809 17763.973.
Far Manager v3.0 build 5511 x64 (2019-11-20)
and Far Manager v3.0 build 5547 x64 (2020-01-22)

Far standalone starts immediately, like cmd and so on.
Inside ConEmu it starts about 5 seconds.
Any command in ConEmu-Far (c: d:), including any exe call takes more than 5 seconds.

Inside ConEmu-cmd console and ConEmu-powershell console everything works instantly!
Braking only with ConEmu-Far :(

Loading

@yuriy-chumak
Copy link

@yuriy-chumak yuriy-chumak commented Feb 12, 2020

Same problem.
ConEmu 191012 [64] {Preview}
Far Manager 3.0.0.5454 x64.
Win10 1809.

Additionally observed "conhost.exe" high load between pressing [enter] in console and actual console command execution even no command exist.
2020_02_12_16_31_31_Greenshot

[append]
I have found that changing in mainmenu/Debug/Properties/Layout "Height" value to lesser than default (9999) solves the issue. But this causes undefined console behavior. So, looks like the system "conhost" is the problem root.

[append 2]
No problem under Win 1903.

Loading

@axfelix
Copy link

@axfelix axfelix commented Feb 19, 2020

Whereas it looks like my longstanding problem with weird delays around pasting and closing tabs in 1903 has been fixed in 2004. go figure.

Loading

@YuriAbele
Copy link

@YuriAbele YuriAbele commented Feb 1, 2021

The problem is still there.
Far Manager, version 3.0.5700.0 x64
ConEmu version 210128

  • Start Far Task in ConEmu take from 2 till 5 seconds.
  • simple DIR takes 3 seconds before start and 3 seconds after

SysInternals Process Explorer with all history graphs displays that the bottleneck is the ConHost.exe sub-process.
3 second before execution of DIR command this sub-process takes 25% CPU then short gap - DIR is executing, then again 25% CPU.
If I repeat this many times then I see. what ConHost returns not all RAM and memory usage grows.

Could we together debug and fix this problem?


UPDATE-1:
Does not install ConEmu, but use portable version.
I think these ConEmu hooks some time destroy ConHost behavior

Loading

@Maximus5
Copy link
Owner

@Maximus5 Maximus5 commented Feb 2, 2021

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Far
  
To Do
Inspection
  
To Do
Linked pull requests

Successfully merging a pull request may close this issue.

None yet