Release-Candidate / vscode-scheme-repl

A Visual Studio Code extension for Chez Scheme, it uses the REPL for autocompletions and to evaluate expressions.
MIT License
13 stars 0 forks source link

REPL doesn't start if scheme path contains spaces (on win64) #28

Closed tracker1398 closed 2 weeks ago

tracker1398 commented 1 month ago

On win64 platform I use the following vscode settings:

Settings -> Chez Scheme: Scheme Path
C:\Program Files\Chez Scheme 10.0.0\bin\ta6nt\scheme.exe

When I start a new REPL, I get the following message:

'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

The same thing happens when I hit Ctrl+Shift+Enter on an expression.

If I copy the scheme system to a directory without spaces, everything works fine.

Release-Candidate commented 1 month ago

But inline evaluation and autocompletion works for you, right? I do not have Windows, but here spaces in the scheme path work with the "internal" REPL, but not when sending to the terminal REPL.

tracker1398 commented 1 month ago

Exactly. The inline evaluation and the autocompletion works well in all situations.

Release-Candidate commented 1 month ago

Great, thanks. I'm trying to escape the spaces and publish a new version. I'm going to post here when it is ready for a test.

Release-Candidate commented 1 month ago

Could you please check the new version 0.7.3 if that is working now?

tracker1398 commented 1 month ago

It works fine now. Thanks!

monospod commented 2 weeks ago

Unfortunately this seems to break having scheme on the PATH in Windows. When I launch Chez Scheme REPL: Start REPL I get this in the terminal:

PS C:\Users\monospod\Documents\projects\play-with-ffi> "scheme"
scheme
PS C:\Users\monospod\Documents\projects\play-with-ffi> (waiter-prompt-string "λ>")
waiter-prompt-string : The term 'waiter-prompt-string' is not recognized as 
...

However, without the quotation marks it finds scheme in my path:

PS C:\Users\monospod\Documents\projects\play-with-ffi> scheme
Chez Scheme Version 10.0.0
Copyright 1984-2024 Cisco Systems, Inc.

> 

This means that the default setting doesn't work on Windows as you'd need to replace it with the full path to scheme?

(Thanks for the extension.)

Release-Candidate commented 2 weeks ago

Thanks for the bug report.

I see, so I'm going to check if the given path contains spaces, and only add the double quotes, if yes.

monospod commented 2 weeks ago

I think tracker1398's terminal might be the command prompt, where-as mine is PowerShell.

The command prompt works for both "scheme" on the path, and the quoted full path. Neither quoted version works with PowerShell, but the unquoted scheme on the path does (confirmed by rolling back to 0.7.2).

Your planned solution for scheme found on the path should work in both PowerShell and the Command Line.

If someone needs to give the full path (with, or without spaces), then they'd need to set the default terminal in the Visual Studio Code preferences to be the Command Prompt: Terminal > Integrated > Default Profile: Windows, as it wouldn't work in PowerShell.

Release-Candidate commented 2 weeks ago

Thank you very much for the information, I'm going to add that to the README.

Release-Candidate commented 2 weeks ago

There is a new version, 0.7.4, which should fix that problem.

I ended up always using cmd.exe and Windows for the pane REPL and removing any unnecessary single or double quotes.

monospod commented 2 weeks ago

Thanks - that's perfect.

I've checked that I still have PowerShell as my default terminal, and that the REPL in the new version launches with the command prompt instead. It works with scheme on my path (and doesn't quote it), and when I used the full path with spaces it quoted it and ran correctly too.

Release-Candidate commented 2 weeks ago

Great to hear and thank you for the feedback, really appreciated!