navi icon indicating copy to clipboard operation
navi copied to clipboard

Support Windows (cmd/Powershell)

Open vko-online opened this issue 4 years ago • 21 comments

Please add support to Windows (Choco, curl)

vko-online avatar Sep 23 '19 04:09 vko-online

Thanks for opening your first issue here!

welcome[bot] avatar Sep 23 '19 04:09 welcome[bot]

Hi! I'm not very familiar with the Windows ecosystem. What setup do you have exactly? WSL? Cygwin? Git for windows?

In any of these cases, installing via git + make should work out of the box and the problem is limited to adding a package to choco, right?

Otherwise, I don't plan to support the vanilla command prompt or Powershell, because navi relies heavily on tools that only exist on Unix-like systems.

The only hope I see for this case is a tool out there able to compile bash scripts to a Windows binary, but that probably doesn't exist.

denisidoro avatar Sep 23 '19 10:09 denisidoro

navi is now written in Rust. It should be relatively trivial to start supporting Windows.

AFAIK, the only change needed is to use cmd/Powershell instead of bash to generate variable suggestions.

denisidoro avatar Mar 04 '20 23:03 denisidoro

Hi! Sorry for the late update.

Being 100% honest here: this is a feature it would be nice to have but unfortunately I haven't had much free time lately, so I have no plans to implement this in the near future.

If anyone could submit a PR for this, I'll gladly accept it, though! 👍

denisidoro avatar May 12 '20 13:05 denisidoro

Work on this front is mostly, if not all, done. In theory, navi should be buildable for the x86_64-pc-windows-gnu target now.

denisidoro avatar Apr 10 '21 20:04 denisidoro

bash still is needed under the hood, but it should be possible to use it under Cygwin now.

(In WSL as well, but that has always been the case)

denisidoro avatar Apr 10 '21 20:04 denisidoro

Can't wait! Maybe also publish to scoop?

Milo123459 avatar Apr 20 '21 18:04 Milo123459

Scoop: https://github.com/ScoopInstaller/Main/pull/2100

Choco: https://github.com/denisidoro/navi/issues/532

Pre-compiled binary: https://github.com/denisidoro/navi/releases

I'd love to hear feedback from Windows users, specially because I don't use Windows so I can't test navi on it.

denisidoro avatar Apr 20 '21 18:04 denisidoro

BTW, bash is still necessary under the hood but, if there's enough demand for it, navi could work entirely under cmd.exe. Please let me know if there's a use case for that.

denisidoro avatar Apr 20 '21 18:04 denisidoro

I mean I think a lot of people want it on windows because of the "command fixing" system, which is literally amazing.

Thanks for the other info.

Oh and, it can work completely under cmd or powershell.

Milo123459 avatar Apr 20 '21 19:04 Milo123459

For chocolatey users, navi 2.15.1 package has been approved. Try it out and if something fails during installation, feel free to report a issue in the package repository.

Package for version 2.16.0 is under moderation and may be approved in few days.

kai2nenobu avatar Apr 28 '21 23:04 kai2nenobu

The PR for scoop is out of date, so I'm making one for this scoop bucket: https://github.com/kidonng/sushi

Btw, making it run entirely on cmd.exe would be best.

Milo123459 avatar May 20 '21 20:05 Milo123459

You can already try running navi entirely on cmd.exe by setting "cmd.exe" as shell.command in the config file: https://github.com/denisidoro/navi/blob/master/docs/config_file_example.yaml

Some stuff will be broken (such as navi repo add and copying to the clipboard) but I can fix reported issues until navi is completely agnostic to POSIX shells.

TL;DR: beta testers wanted

denisidoro avatar May 20 '21 21:05 denisidoro

Added Navi to my custom scoop repo Milo123459/cone.

Milo123459 avatar Jun 19 '21 18:06 Milo123459

If you get the time, please make a widget for powershell.

Milo123459 avatar Jun 19 '21 18:06 Milo123459

I have zero experience with Powershell :(

I created https://github.com/denisidoro/navi/issues/570 with the label "help wanted", though.

If someone submits a PR, I'll gladly review/merge it!

denisidoro avatar Jun 20 '21 15:06 denisidoro

PowerShell 7+ is absolutely amazing. Would be indeed great to have it. Easy to learn too.

kboom avatar Nov 28 '21 07:11 kboom

In fact it works! You just have to change https://github.com/denisidoro/navi/blob/master/docs/config_file_example.yaml to use powershell, and use choco to install it. Should be better documented, as this is great!

kboom avatar Mar 05 '22 21:03 kboom

Sorry for the confusion.

PowerShell should be working for a while, indeed.

What I meant is that navi currently doesn't support a PoweShell shell widget (see https://github.com/denisidoro/navi/issues/570)

denisidoro avatar Mar 06 '22 10:03 denisidoro

It doesn't work well with variables in the case of PowerShell. When I select a command that expects a variable:

image

kboom avatar Jun 02 '22 14:06 kboom

It would be great if there was support for specifying config path. https://github.com/ScoopInstaller/Main/issues/4647

HUMORCE avatar Aug 02 '23 09:08 HUMORCE