cmderdev / cmder

Lovely console emulator package for Windows
https://cmder.app
MIT License
25.81k stars 2.02k forks source link

Even though `vi` is in PATH, PowerShell returns "The term 'vi' is not recognized as the name of..." #2817

Open Znoy108x opened 1 year ago

Znoy108x commented 1 year ago

Question

When I do vi abhay.txt the terminal shows this error, even though I have added the vim in the path

image image

Checklist

DRSDavidSoft commented 1 year ago

Hi there, since you're on PowerShell please run the following commands:

Get-Command -All vim | ForEach-Object { Write-Host $_.Source }

And

Get-Command -All vi | ForEach-Object { Write-Host $_.Source }

And

Write-Host (($Env:PATH -Split ";")-Join "`n")

Then paste output of each command separately here.

Note: copy and paste as text, do not take a screenshot

Znoy108x commented 1 year ago

C:\Users\Hp>Get-Command -All vim | ForEach-Object { Write-Host $_.Source } 'Get-Command' is not recognized as an internal or external command, operable program or batch file.

C:\Users\Hp>Get-Command -All vi | ForEach-Object { Write-Host $_.Source } 'Get-Command' is not recognized as an internal or external command, operable program or batch file.

C:\Users\Hp>Write-Host (($Env:PATH -Split ";")-Join "`n") 'Write-Host' is not recognized as an internal or external command, operable program or batch file.

DRSDavidSoft commented 1 year ago

You executed the commands in cmd.exe shell rather than PowerShell.

On cmd.exe, please run the following commands instead and post the results:

where vim

and

where vi

and

set PATH