Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.57k stars 573 forks source link

ConEmu not responding after pasting with Ctrl-V #2497

Open gene-pavlovsky opened 1 year ago

gene-pavlovsky commented 1 year ago

Versions

ConEmu build: 221218 stable x64 (this is happening for months already, I'm normally on alpha versions) OS version: Windows 10 22H2 x64 Used shell version (Far Manager, git-bash, cmd, powershell, cygwin, whatever): Far Manager

Problem description

Occasionally, ConEmu stops responding when trying to paste (Ctrl-V) a command into Far's command line. ConEmu/Far doesn't respond, clicking on the window shows the typical Windows dialog about process not responding , close / wait. Waiting doesn't help. If I click close, ConEmu exits, after this the child Far's window shows up in a small console window. The Far itself responds to input and is not stuck. Unfortunately the detailed steps to reproduce are somewhat involved, I noticed this happening only under the following conditions.

Steps to reproduce

Note: 3rd party software is referenced in the steps, I don't know if it's important to use these particular ones. Perhaps it would be reproducible with any similar ones, perhaps not. Whatever it is, I feel like ConEmu shouldn't be crashing/freezing with these steps... The 3rd party software I'm using:

  1. Prepare a directory, containing multiple subdirs, each containing video file(s) (music videos, porn, movies, series, etc)
  2. Copy all subdir names (e.g. in Far, select all subdirs, press Ctrl-Ins)
  3. Open a text editor,
  4. Paste all subdir names, then run a regexp replace to add cd ../ to the beginning of each line (resulting file has lines like cd ../movie1, one for each subdir). Optionally, shuffle all the lines, but I think it doesn't matter for reproducing this issue.
  5. Enter any video dir
  6. Play a video file from the dir
  7. Exit the video player
  8. Alt-tab to the text editor, copy (Ctrl-C) a random line from the list
  9. Alt-tab back to Far, paste (Ctrl-V) the line, hit enter
  10. Go back to step 6 and repeat until ConEmu freezes on step 9

This "workflow" may sound unusual but it's what I do when I want to watch a few randomly selected videos, when each video has its own directory.

Note: It's possible that the steps 7-9 should be performed quite quickly. Note: Dunno if it's important but in my case, the videos are all on a mounted network share (a NAS on the local network), accessed via WiFi.

Actual results

Many times, nothing bad happens. Often, on step 9 it takes unusually long (e.g. 1 second) for the pasted command to appear on Far's command line. But from time to time, ConEmu completely freezes and doesn't respond to any input. If the window is clicked, Windows offers to close it or wait. Waiting doesn't help. Closing kills ConEmu, after which a very small Far window is shown, the Far itself is responsive.

Expected results

Paste working quickly, and especially ConEmu not freezing

Additional files

It seems like the issue is happening when the system is under load. When closing the video player, I assume the video player itself and various codecs/filter processes that it employs are shutting down, doing some cleanup or whatever, creating some load. When the copy-pasting is done during this short load period, something goes wrong, some deadlock or race condition perhaps, making ConEmu stuck. Note: the only load I'm talking about is from the "steps to reproduce" itself, I don't have any other CPU-intensive stuff running when the problem occurs. The computer is not new, but still quite powerful - it's a ThinkPad W530 laptop with an Intel i7-3940XM, 4C8T (base 3.00 GHz, turbo 3.90 GHz).