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.
Related
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.
I installed amazonCLI, as well as Cygwin, and changed the Path env variable to:
%SystemRoot%\System32\Wbem;C:\Program Files\Prio;C:\Program
Files\Diskeeper Corporation\ExpressCache\;C:\Program
Files\Amazon\AWSCLI\;C:\cygwin64\bin
When I open the command prompt, first of all it is directly pointing to
C:\Users\Stephane
(which I think is weird). And then when I input something like 'ls', the return error is:
'ls' is not recognized as internal or external command, operable program or batch file
Can you please help me know what I am doing wrong?
Thanks
From the error message you got, it's evident, that you are trying to execute Cygwin's commands from the Windows Console. That's also the reason, why it's executed in your Windows' profile directory instead of the Cygwin's one.
You should read the basics about using the Cygwin first, because it seems you don't know what Cygwin exactly is and how to use it. Maybe you don't need the Cygwin at all, it depends on what you need to accomplish. The is for example GnuWin tool set or UnxUtils, which are just a sets of standalone GNU tools compiled for Windows. Cygwin is more like system than standalone utilities. You can for example execute shell scripts under the Cygwin.
So it depends on your needs. But I simply can't imagine using Windows without Cygwin yet.
You can execute Cygwin's shell from the Windows Console, but I advice you to use MinTTY (which is in directory $CYGWIN_DIR/bin). MinTTY is a terminal emulator, which executes your Cygwin shell (bash by default).
To execute for example bash directly from the Windows Console, just execute $CYGWIN_DIR/bash.exe --login -i.
I am trying to run a cygwin script in powershell. How can I do that?
I tried giving full path of the scripts followed by args . it isnt working
example : /c/script/path/script args
Use either /cygdrive/c/script/path/script or C:/script/path/script (note the capital C and lack of leading slash in the latter path). Plus, need to run the script with the correct interpreter, e.g.:
& C:\cygwin\bin\bash.exe /cygdrive/c/script/path/script ...
Having cygwin installed with the ssh stuff and SCP utility you can simply issue:
C:\cygwin\bin\scp.exe /cygdrive/c/Users/YOU/Documents/file.txt root#remoteserver:/tmp/
I find above can marked solution becomes a bit too shortcoming as the bash profile is not quite the same as in a working cygwin bash environment.
When I start servers using ant command, bash prompt does not get returned. Prompt is available only if I press Ctrl+Z or stops servers from another cygwin shell.
I'm using cygwin 1.7.13-1
cygwin.batch has following env variables set
bash --login -i
set SHELLOPTS=igncr
set CYGWIN=nodoswarning
Please see this documentation related to Cygwin and the section below it on running Ant as a background process.
Probably something like:
ant </dev/null &
Installing 1.7.15-1 version fixed the problem
I am attempting to get python to run in a command shell in emacs. I have tried the standard M-x shell that comes with windows emacs and then type 'python' but python just hangs up (no output). I have also tried running other program shells such as bash.exe from cygwin with the same result. Any way to get a shell that can run other programs like python?
Why not use M-x python-shell? This provides an interactive REPL for Python within Emacs.