Some time ago I installed clink on one PC and it supports bash commands, like pwd, ls. Now I installed it on another PC and these commands are not recognized. Other features of clink, like auto-completion, reverse-i-search, prompt color are still supported. The versions of Clink on both machines are the same: 0.4.9. I checked installation folder, settings on both PCs and its also the same. Both PCs are Windows 10. I don't remember what I did to have support for these commands, I think I did nothing special - I got them right out of the box. Does anyone know how to make clink support bash commands?
- 121
2 Answers
I have no experience with Clink at all, but it seems it's just Readline for cmd.exe. It does not provide commands; it handles command line editing, command history, completions, keyboard shortcuts.
I guess the first PC got pwd and ls (or rather pwd.exe and ls.exe) from elsewhere, e.g. from Cygwin. If proper executables with such names are available in PATH then they will be recognized with or without Clink.
Side note: while pwd is a standard builtin in Bash, ls is not. Strictly: Bash does support dynamically loadable builtins, so one can implement ls as a builtin; but usually it's not a builtin. Therefore calling ls a "bash command" is a misunderstanding. It's a standalone command.
- 81,893
You might have installed Git from
https://git-scm.com/download/win or
https://gitforwindows.org/.
When pwd runs from your windows command line, a likely source is
C:\Program Files\Git\usr\bin\pwd.exe.
By default C:\Program Files\Git\usr\bin is not added to your PATH
environment variable, so you may want to do this yourself, as follows.
Hit the win key on your keyboard, and then paste or type
envi. Click on Edit the system environment variables. Click on
the button down to the right named Environment Variables....
In the System variables frame, scroll down and double-click on PATH
as in the figure below.
A window titled Edit environment variable opens. Click on the
New button and then paste or type C:\Program Files\Git\usr\bin.
Click yourself out (three times on OK).
Please note that you need to close and restart cmd.exe
(the terminal window) for the changes to take effect.
The emulated Unix commands in C:\Program Files\Git\usr\bin should now
work from anywhere in the command line.
- 1,261
