Open pseudosavant opened 1 year ago
I did notice that the getExecPrefix()
tests for Powershell and cmd.exe
will always be false as SHELL
is not set in the environment for cmd.exe
or Powershell. You can check for cmd.exe
by checking Deno.env.get('comSpec')
;
Ah sorry, @pseudosavant, I have never tested on Windows.
A few clarifying questions:
Is this a new issue on the most recent version – it was working on Windows before?
I was under the impression Deno.run
still is available until Deno 2.0. Can you share the error message related to this that led you to forking?
the current code out it would give me this error message even before I changed any code
gpt
without any arguments. Did you try running something like gpt hello world
to make sure it's working?Installing on Windows always seemed to error on the last step but was easily overcome with by just running the command it showed: deno install -frA -n gpt https://deno.land/x/shellgpt/mod.ts
. Everything worked fine once installed that way. I assumed it probably hadn't been tested on Windows much.
It seemed that 0.33 worked fine initially when I upgraded to it. But once I removed it and tried to install from local (to try making it work with Deno.command
but at some point it started throwing the errors below. I typically use it with --repl
and that doesn't work at all. These screenshots show it being installed and then invoked a few ways:
Deno.run
invocation that it was related to the deprecation. I didn't see where it is still going to be available until 2.0.Ah okay. Very sorry for breaking things. @pseudosavant
It looks like the issue is Deno.stdin.setRaw
does not support Windows. This is used to support newline pasting. But since that's not available, I think unfortunately this functionality can't easily work for Windows.
Any reason not to use cygwin
, ConEmu
, git bash
, WSL
, etc. for terminal instead of cmd.exe
? I think everything should work fine with those.
You can also install an earlier working version with deno run -rA https://deno.land/x/shellgpt@0.3.1/install.ts
until I get around to fixing it.
I will use the previous version when in cmd.exe
until there is a fix. It looks like Deno may be working in this area (setRaw + Windows): https://github.com/denoland/deno/blob/806137bb96c6f7e4b359a6e979c4e22d3a04a55c/Releases.md?plain=1#L533.
It would seem like that method only working on Linux and Mac OS would mean it should throw an error on Windows. At least then you could fall back to the previous prompt()
behavior.
cmd.exe
is just always there, and starts the fastest. It depends what I want to do. I have ShellGPT installed in Windows/cmd and WSL/bash.
Deno.run
has been deprecated and replaced withDeno.command
. See https://deno.land/api@v1.35.2?s=Deno.CommandI did try fixing it in a fork, but when I checked the current code out it would give me this error message even before I changed any code: