Add option to set the temporary directory path on Windows. Also a few smaller changes. #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey,
I ran into the same issue as described in #15, #32 and #56 (even after #81 & #82). So I started digging and came up with a solution/workaround.
What's the problem?
As of May 2020, MiKTeX does no longer support short filenames (aka 8.3 filenames). Unfortunately in my case the path to the temporary directory as given by
Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile).path
includes short filenames.If I run the command that LaTeX It! shows in the debug box manually (with the paths adjusted), everything works fine.
What I considered:
I tried finding a reasonable way to extract the full path in the given framework, but had no success:
Cc["@mozilla.org/process/environment;1"].createInstance(Ci.nsIEnvironment).get("TEMP"/"TMP")
instead, but it also contains short filenames.nsIFile
does not exactly represent a file (handle), but a string (the path). As such, many of its properties and methods are just string manipulations. A notable exception isexists()
which is indeed a true file operation.Also, I haven't found a way to pass a working/execution directory to
nsIProcess
. Otherwise you could just launch the executables from the temporary directory.What I came up with:
I added the option to change the path of the temporary directory. This setting is only used and shown on Windows.
During this I discovered a few other issues that I also tackled:
fontpx_textbox
are not displayed.async function file_exists()
is used in expressions withoutawait
. As the result is a promise, it is always true.I tested my changes on:
On these systems, everything seems to work fine. I don't have the possibility to test on OS X.
If some or all of these changes are desirable, please feel free to use them any way you like. Please tell me if you want this PR split up.
Max