LSP-rust-analyzer
LSP-rust-analyzer copied to clipboard
Run button is not working on Windows
Run button , opens new Terminus tab with this error message:
error: couldn't determine self executable name process is terminated with return code 1.
Sublime Text 4 build 4121 LSP v1.12.1 LSP-rust-analyzer v1.0.1 Terminus v0.3.23
Works fine here. This sounds like something Cargo-specific.
@rwols, all cargo actions from "Build With..." works fine. Could this be happening because I am using CARGO_HOME
and RUSTUP_HOME
environment variables, to redefine default locations for .cargo
and .rustup
folders?
upd:
Nope, .cargo
and .rustup
symlinks in user folder don't fixed the problem.
upd2: I don't know Python, but I tried to investigate this. So I modified plugin.py and put in open_runnables_in_terminus func
print(terminus_args)
before
window.run_command("terminus_open", terminus_args)
To see if terminus_args valid. What I get:
{'title': 'run create-window', 'auto_close': False, 'cwd': 'E:\\Programming\\Windows.Education.Rust\\com.microsoft.windows-samples-rs\\create_window', 'cmd': ['cargo', 'run', '--package', 'create-window', '--bin', 'create-window']}
If I manually open the Terminus tab and paste the same thing into it, it works:
But if I just press the run button, I get:
To exclude all possible errors from my side, I decided to check everything in a virtual machine with a clean operating system. What I did, step by step:
- installed Rust via
rustup-init.exe
with default parameters; - downloaded portable
Sublime Text 4 Build 4121
for Windows; - installed
LSP
,LSP-rust-analizer
,Terminus
packages; - created
hello_world
withcargo new
; - added
hellow_world
folder to editor viaProject
->Add folder to project
; - pressed
Run
button.
And after all, I get the same error:
Hey so sorry about that , so do the args the LSP sends to terminus work fine? Like when run. Based on this I'm not sure exactly whats happening. Does Terminus work okay as well?
I am encountering the same problem, is anybody able to solve this on windows 10?
This seems like a Terminus issue, this aa.sublime-build
illustrates it (add this file to your sublime user folder and run a build with: aa
command on any file):
{
"cmd" : ["cargo"] , // this works
// "cmd" : ["cargo","--version"] , // this fails with couldn't determine self executable name
"target" : "terminus_exec",
}
Commenting out terminus_exec
target make both commands work (so does using exec
as a target)
There is this exact issue opened https://github.com/randy3k/Terminus/issues/310, though no solutions there either
Found the solution — https://github.com/randy3k/Terminus/issues/368 depends on a very old and buggy winpty, if you manually use the updated pypi versions of Terminus deps (in your Data\Lib\python38
as pypi has no 3.3 versions and some deps have a min py version above 3.3) and also install Terminus manually without package control (so that it doesn't auto-install those dependencies), then the Run button works!
Found the solution — randy3k/Terminus#368 depends on a very old and buggy winpty, if you manually use the updated pypi versions of Terminus deps (in your
Data\Lib\python38
as pypi has no 3.3 versions and some deps have a min py version above 3.3) and also install Terminus manually without package control (so that it doesn't auto-install those dependencies), then the Run button works!
@eugenesvk Can you help to provide more detailed guidance on how you performed to make this work? That can help a lot.
maybe try this (or this fork with vendored dependencies seems to also work https://github.com/eugenesvk/Terminus/tree/vendor38 by installing all deps locally with the package)
- install Terminus, extract it with PackageResourceViewer (or install from github locally)
- remove
dependencies.json
file from Terminus' root to not auto-install deps - add
.python-version
file with3.8
to Terminus' root to load in the 3.8 plugin host - extract/copy 3 python packages
pyte
,wcwidth
,pywinpty
(3.8 version for pywinpty, others work in any) to theData\Lib\python38
folder of your sublime text install (I think I just installed packages with pip and copied them or maybe manually downloaded and extracted.whl
distributions, don't remember)
I'm having this problem now, is there a solution?