gow icon indicating copy to clipboard operation
gow copied to clipboard

"Clear" command doesn't work on Windows 10

Open emkultra64 opened this issue 8 years ago • 4 comments

For whatever reason, Gow doesn't want to be able to run clear on my windows 10 installation.

When I typing it in, I get the following output: bash.exe: clear: command not found

Typing in the absolute path doesn't execute the command either, and calling cls while in bash produces the same "not found" error. cls does, however, work fine under normal cmd.exe.

emkultra64 avatar Sep 19 '16 00:09 emkultra64

A good work around is to create a new script that will clear the screen the way cls does under MSYS. Just use the following commands to create the script:

cd /bin
echo 'echo -ne "\033[2J"' > clear

emkultra64 avatar Sep 19 '16 00:09 emkultra64

The reason it doesn't work in bash.exe is because it's a a batch file (clear.bat), which contains simply

@echo off cls

And since bash doesn't handle bat files, nor would it handle batch commands if it did... It's not supposed to work that way.

bytehead- avatar Sep 19 '16 01:09 bytehead-

My bad, I was under the impression that bash under gow was essentially meant to be the default shell. I see now that the purpose of gow is mainly to add unix commands to cmd.exe rather than provide a full bash shell that would replace cmd entirely.

Nonetheless, it would be good for there to be a version of clear that is compatible with bash included in the default installation. Maybe not necessarily replacing clear.bat, since that would interfere with using it under the default Windows shell, but maybe as an extensionless file like I mentioned?

emkultra64 avatar Sep 19 '16 01:09 emkultra64

MikeIronFist, thanks for the suggestion. While I did not make it a file in bin I did make it an alias in my bashrc. Fixed my problem. Thanks again.

mvheslin avatar Sep 24 '17 21:09 mvheslin