denisidoro / navi

An interactive cheatsheet tool for the command-line
Apache License 2.0
15.21k stars 507 forks source link

/usr/bin/bash: line 1: C:ProgramDatachocolateylibnavitoolsnavi.exe: command not found #897

Open hslima00 opened 6 months ago

hslima00 commented 6 months ago

Describe the bug Any navi command results in a error in windows 10, installation from scoop.

To Reproduce Steps to reproduce the behavior:

  1. Use winget to install navi from scoop, version 2.23
  2. Open cmd and run navi
  3. Error shown: /usr/bin/bash: line 1: C:ProgramDatachocolateylibnavitoolsnavi.exe: command not found

Expected behavior Normally run navi

Screenshots

image image

Versions:

image
welcome[bot] commented 6 months ago

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

wangshuai-007 commented 5 months ago

It is correct in windows .

If you want use navi in windows, you must create command by yourself.

First, you should create your cheats file. by default,It is %AppData%\navi\cheats\ Then create yourself cheats fold, just like my_cheats,if fold not exist ,create it. the full path is %AppData%\navi\cheats\my_cheats\ Then you can create your first sample cheat file in my_cheats folder. There is my ii.cheats

% ii

# ii open my_cheats path
powershell.exe  'ii "\$env:AppData\navi\cheats\my_cheats"'

Then, run command navi -p C:\Users\{user}\AppData\Roaming\navi\cheats\my_cheats, select ii command.

the -p param is your chaeats folder's real full path.

It will work.

Next time,just run navi command ,your cheats file in my_cheats will include.

Reyhn3 commented 4 months ago

I have the same problem in PowerShell, but I downloaded the binaries from the release page (not via a package manager).

If I run .\navi.exe repo browse and select a source, cheats will be downloaded, but I still get the same /bin/bash: line 1: C:Toolsnavinavi.exe: command not found as described.

Reyhn3 commented 4 months ago

Ah, I solved it. It was hard to find, but it is actually in the documentation.

First, create a config file:

.\navi.exe info config-example > $ENV:AppData\navi\config.yaml

Then, change shell → command from "bash" to "cmd.exe" (as it says in the comment). Done.

antonkrusche commented 1 month ago

In case you want to use bash I described a workaround for this problem in #794 It enables almost all previewing capabilities of navi when using bash on windows