Using Windows subsystem for Linux in Sublime - windows

For example, how to run "make" command in Bash instead of CMD ? I tried to write my own buildsystem "bash -c make", but sublime can't recognize commnad bash (which is added also to PATH). Thanks :)

Related

fzf not workign with git bash (installation via scoop)

I installed fzf via scoop on windows 10 but unfortunately it works well on cmd but impossible to make it work on git bash. I found a similar topic here: Is it possible to use fzf (command line fuzzy finder) with windows 10 git-bash?
but i don't understand these commands at all.
I checked the shims( the Windows command-line installer.) files of fzf and I have this as path
path = "C:\Users\<user name>\scoop\apps\fzf\current\fzf.exe"
fzf works fine on cmd but I need the bash interpreter. It's very annoying, anyone have an idea?
When I write
`fzf --help`
the command is recognized on git bash, it means that the command works but it returns nothing.
For Windows 10 (git bash) - try winpty fzf
You can also set an alias in .bashrc:
alias fzf="winpty fzf"

wsl executes only bash commands and not windows options

When I try to execute cmd commands such as wsl -l, wsl returns this message:
/bin/bash: -c: option requires an argument
However, using wsl as a bash command launcher works.
What do I have to do in order to use wsl windows options such as wsl -l, wsl --install, etc.?
Thanks in advance!
I assume that you've entered wsl command in the Linux terminal and when you did this the first time bash answered you that the command was not found , so you installed 'wsl' package. This is a completely different package. If you want to invoke Windows binaries from bash you should use .exe file extension. Try wsl.exe -l

how to write a batch (windows) to start Cygwin (mintty.exe) and then execute a python script?

Pretty much as titled. If I were to manually do this, I would first open a Cygwin Terminal (which should be /cygwin/bin/mintty.exe), and then in that terminal, cd to the directory that has the python script, and then execute the python script by doing "python myPython.py". I'm wondering if I can write a batch script or a bash script to do this: start a Cygwin Terminal, cd to a directory, execute a python script in the directory.
Thanks.
Edited:
So I have a python script that generates csv files for activities through mongodb.This script won't function if I run it through windows cmd. I have to run it in cygwin terminal (mintty.exe). So any alternatives to execute the python script won't work. I have to somehow start a Cygwin Terminal and execute the python script through there. Any ideas please? Thanks.
Depending of your needs it could be better to start mintty (creating a new window) instead of starting bash inside the cmd.exe window.
When you want to use ansi escape sequences then it works better with a real mintty window, as the cmd window ignores the escape sequences for window resizing and positioning.
start "" C:\cygwin\bin\mintty --exec ./myProgramToExecute.sh
You may start a bash from the Windows terminal and start your script from there (without starting mintty.exe). Just execute
bash -c "cd /your/directory && python myPython.py"
from the Windows cmd prompt or a batch file.

call perl script in cygwin

I would like to start perl.pl within a cygwin terminal such that perl.pl starts in a new cygwin terminal.
What is the best way to do this?
So far I've tried to use system(perl.pl) and exec(perl.pl), but that runs the perl script within the windows command line, not cygwin.
As you can see by viewing the properties of the shortcut, the command that opens the terminal is
mintty.exe -i /Cygwin-Terminal.ico -s 105,60 -
So you'd run
system('mintty perl.pl');
Use command xterm:
xterm -hold -e perl.pl

sbt: Can't run interactively from mintty on cygwin

When I run sbt interactively from a DOS shell or from a cygwin bash terminal, it functions just fine. However, when I try to run from my preferred mintty terminal, sbt doesn't respond to my commands until I send it an end of file (control-) and sbt exits.
TERM is set to cygwin when I'm using the bash terminal, and it's xterm when I'm using mintty.
Does anyone know how to fix this?
It ends up that by doing the opposite of this answer, I added the -Djline.terminal=jline.UnixTerminal java option to my sbt startup script to fix the problem.

Resources