Webstorm Terminal "File Not Found"

Trying to run a command, which works in a Windows command prompt, in the Webstorm terminal resulted in "... is not recognized as an internal or external command ...".  I confirmed the terminal PATH was correct, still no joy.   Even doing a "dir" command for the file fails with "File Not Found" in Webstorm terminal.  Works fine in Windows command prompt.  What am I missing?

12 comments
Comment actions Permalink

What shell do  you have configured in Settings | Tools | Terminal | Shellpath? Try running

echo %path% in WebStorm terminal and in Windows command prompt - what is the result?
0
Comment actions Permalink

Shell:  cmd.exe
echo %path% in Webstorm Terminal and Windows command prompt yield the exact same.  

It's obviously not a path problem when doing a "dir grep*" in the directory where the file resides results in "File Not Found" in Webstorm Terminal.

0
Comment actions Permalink

to me, the results of running this command are the same in webstorm terminal and windows cmd console.
Please attach the screenshots (same command in same directory in both consoles)

0
Comment actions Permalink

I get 'file not found' in my Windows cmd console as well - as 'grep' is not a part of Windows command line interface. You must have ported UNIX grep command to Windows somehow, and this extension is not available in built-in terminal

0
Comment actions Permalink

The fact that grep is not part of windows is irrelevant.  The command being executed is "dir" which is part of windows command line interface.  

0
Comment actions Permalink

it IS relevant. This is what I see when executing this command in Windows cmd console:


grep.png

and without grep:

dir.png

0
Comment actions Permalink

See http://www.computerhope.com/dirhlp.htm for dir command syntax. As 'grep' command is unknown, 'grep*' is treated as a file name. And command returns 'file not found', as no such files exist in the directory

0
Comment actions Permalink

Of course, because you don't have a file that starts with "grep" in that directory.   I do have a file that starts with "grep" in my windows\system32 directory.   In fact, taking "grep" out of the equation and just running  "dir" in the windows\system32 directory yields strange results:

Webstorm Terminal:
2244 File(s)  1,034,703,922 bytes
     87 Dir(s)  334,607,814,656 bytes free

Windows Command Prompt:
2697 File(s)  1,305,373,451 bytes
     97 Dir(s)  334,607,785,984 bytes free

0
Comment actions Permalink

I observe the same results (Windows 7 Ultimate x64 SP1 ENG).

What Windows do you have extactly? I assume it's 64-bit edition, right?

If so then it's expected/normal:

  • When you run "dir" using Windows terminal cmd.exe (outside of IDE) it will be x64-bit and folder will be C:\Windows\System32
  • When running from 32-bit IDE (better say, IDE running under 32-bit Java) the cmd.exe will also be running 32-bit; and C:\Windows\System32 will be transparetly mapped to C:\Windows\SysWOW64


Go to C:\Windows\SysWOW64 in terminal outside of IDE and compare results with what you see when running inside IDE.

Possible solution: run IDE using 64-bit Java ... or make sure that you have your grep* files in both folders.

0
Comment actions Permalink

Andriy,

Thank you.   I assumed that since I'm running 64 bit windows, your installation would have configured the Webstorm desktop shortcut to launch Webstorm64.exe.   I changed the shortcut and the terminal appears to be working correctly.

0
Comment actions Permalink
I assumed that since I'm running 64 bit windows, your installation would have configured the Webstorm desktop shortcut to launch Webstorm64.exe.


1) I do not work for JB

2) Webstorm64.exe requires 64-bit Java installation to be installed on your computer. By default, on Windows PhpStorm comes with its' own 32-bit Java and does not use your Java unless configured to do so.
https://intellij-support.jetbrains.com/entries/23455956-Selecting-the-JDK-version-the-IDE-will-run-under

But yes -- I think it could behave like you have described one day in the future (at least offer such option during installation).

0

Please sign in to leave a comment.