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

Run config editor freezes when WSL bash asks for user input #1680

Closed
jschwe opened this issue Dec 4, 2020 · 12 comments · Fixed by #1681
Closed

Run config editor freezes when WSL bash asks for user input #1680

jschwe opened this issue Dec 4, 2020 · 12 comments · Fixed by #1681
Assignees
Labels
bug Deficiencies in TeXiFy behaviour.
Milestone

Comments

@jschwe
Copy link

jschwe commented Dec 4, 2020

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

CLion 2020.3
Build #CL-203.5981.166, built on December 1, 2020
Runtime version: 11.0.9+11-b1145.21 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1987M
Cores: 12
Registry: run.processes.with.pty=TRUE
Non-Bundled Plugins: nl.rubensten.texifyidea, org.toml.lang, org.rust.lang

Operating System

Windows

TeXiFy IDEA version

0.7.1

What I did (steps to reproduce)

  1. Create a new LaTeX Project (The standard one created by this addon)
  2. Click Add Configuration (There is no default configuration, not sure if this is intended)
    3.a Select LaTeX from the list of templates
    3.b Click + and select LaTeX

Both 3.a and 3.b cause the window to freeze. It can still be resized, but it does not react to any clicks or Alt-F4.
Text/images dissappear if the window is resized to the smallest possible and then resized back to the previous size, i.e. the portions become blank.
Other Templates such as Makeindex do not cause this.
Clion must then be force closed via Task manager since it does not recover.

I haven't used Texify Idea in a while so I can't say for sure if this is a new issue.

@jschwe jschwe added bug Deficiencies in TeXiFy behaviour. untriaged Issue type still needs to be triaged or verified. labels Dec 4, 2020
@PHPirates
Copy link
Collaborator

I cannot reproduce the problem on Windows with 0.7.1 in CLion. I don't know what the problem could be. What happens if you create a run configuration from context, using ctrl+shift+F10 or the gutter icon next to \begin{document}? As that is the intended way to create run configurations.
It could be related to some LaTeX or other system tool hanging, but TeXiFy should have a timeout on using those.

You can also try a different IDE like IntelliJ, then we know if it's CLion specific or not.

@jschwe
Copy link
Author

jschwe commented Dec 4, 2020

or the gutter icon next to \begin{document}
Selecting run creates a new configuration "main" that invokes pdflatex and compiles (with an error in BibTeX: "I found no citation commands", but that is probably expected).
Selecting Edit Configurations afterwards shows that two configurations were created: BibTeX and LaTeX. However, the windows immediately is unresponsive, even without selecting anything.

I also checked with IDEA Ultimate 2020.2.3 and Texify 0.7.0, where I also see the same freeze when creating a new configuration.

Additional information:
I'm using Texlive 2020 and I haven't experienced any issues using VS Code + LaTeX workshop.
I have Texlive installed on both windows and in WSL2, however I don't have WSL (or any other toolchains) configured in CLion.

@PHPirates
Copy link
Collaborator

Ok, so apparently there is something unusual in your system that TeXiFy can't handle. How did you install TeX Live on Windows? Can you check in the terminal if pdflatex --version returns output?

You could also try installing the latest alpha version, because I think I did make some relevant changes, but I doubt it will help (will need IntelliJ 2020.3 if you also want to try it in IntelliJ).
See the wiki for how to install an alpha version: https://github.com/Hannah-Sten/TeXiFy-IDEA/wiki/Alpha-builds

@jschwe
Copy link
Author

jschwe commented Dec 4, 2020

Okay, I've narrowed it down. I have keychain in my .profile in ubuntu on WSL2 to start ssh-agent. It asks for my password on first start of a shell after booting.
Texify seems to start a bash session in WSL2 (see picture), even though my project is located on Windows. Since keychain (on ubuntu) expects a password, this causes the freeze if I haven't unlocked keychain yet.

grafik

@PHPirates
Copy link
Collaborator

PHPirates commented Dec 4, 2020

Apparently TeXiFy cannot detect any native LaTeX installation on your system (using pdflatex --version) and then defaults to TeX Live via WSL. What do you expect TeXiFy to do? Which LaTeX installation should it use?
I will double check why it doesn't timeout when starting a bash session in WSL.

[Edit] I do see a timeout being set on bash -ic "pdflatex --version", so I don't really know why that would hang. Perhaps there's a different command that is hanging. I could try to reproduce your situation, with a WSL asking for password without having a native LaTeX installation.

@jschwe
Copy link
Author

jschwe commented Dec 4, 2020

pdflatex --version 
pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX)
kpathsea version 6.3.2
Copyright 2020 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.02

This works both with powershell and cmd.
$env:PATH contains C:\texlive\2020\bin\win32

Edit:
Compiling with

using ctrl+shift+F10 or the gutter icon next to \begin{document}

worked fine too, so I suspect that checking if texlive is in WSL is done always, and not only if Texlive is not found on windows PATH?

@PHPirates
Copy link
Collaborator

PHPirates commented Dec 4, 2020

Yes we do that in order to show you the available options for LaTeX installations in the run config dropdown. But apparently the timeout is not working correctly, I will try to reproduce that.

Can you try the latest alpha build?

[Edit] I can reproduce the problem now, thanks!

@jschwe
Copy link
Author

jschwe commented Dec 4, 2020

Using 0.7.2-alpha5 I can still reproduce the problem.

I can reproduce the problem now, thanks!

great, thanks for your quick replies!

@PHPirates PHPirates changed the title CLion Freeze when selecting LaTeX Run/Debug Configuration Template Run config editor freezes when WSL bash asks for user input Dec 4, 2020
@PHPirates PHPirates removed the untriaged Issue type still needs to be triaged or verified. label Dec 4, 2020
@PHPirates PHPirates self-assigned this Dec 4, 2020
@PHPirates PHPirates added this to the b0.7.2 milestone Dec 4, 2020
@PHPirates
Copy link
Collaborator

Can you check if the following build resolves the problem? Opening the run config editor will be a bit slow only the first time.

TeXiFy-IDEA-0.7.2-alpha.6.zip

@jschwe
Copy link
Author

jschwe commented Dec 4, 2020

Using the zip you provided I observed the following:

  • When selecting LaTeX as a configuration for the first time the window freezes for a short amount of time (< 5 seconds)
  • Afterwards everything is smooth
  • The wsl bash seems to be still open in the background indefinitly ( I can still see it in the Task Manager)
  • When opening the wsl shell Keychain says: "Waiting 5 seconds for lock...". This indicates again that the session opened by Texify was not closed.

So yes, this fixes my issue. Depending on how much effort it is I guess it would be nice if texify would close the wsl session again (buts thats really a minor issue I guess).

@PHPirates
Copy link
Collaborator

Good point, I did not test it but this should do that:

TeXiFy-IDEA-0.7.2-alpha.6.zip

@jschwe
Copy link
Author

jschwe commented Dec 4, 2020

I tested the new zip, but the behaviour didn't change compared to the last one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Deficiencies in TeXiFy behaviour.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants