I have tried to use Vim both on Cygwin and MinGW but many times the characters behave in an unpredictable manner (backspace is not deleting, cannot have a semicolumn, and so on...). I am wondering if this is related to those systems or if it could be a problem of my own system/settings (e.g I need to adjust some settings, define the character encoding, etc.). I am on windows 7 64bit
Thank you
The Cygwin CMD emulator has a known problem with Vim. Seems to be a redraw problem. Apparently fixing it would break execution of some exes that Cygwin depends on. Many users choose to use another terminal emulator. I find that paging down and back up fixes the redraw but sometimes I have to exit Vim and relaunch.
PuTTYcyg is a patched version of PuTTY that, in addition to telnet, rlogin, ssh, and serial connections, can also be used as a local Cygwin terminal instead of the Windows console or xterm. See README.txt on the PuTTYcyg site for more information.
To use rxvt:
#echo off
C:
chdir C:\cygwin\bin
set EDITOR=vi
set VISUAL=vi
set CYGWIN=codepage:oem tty binmode title
rxvt -sr -sl 10000 -fg white -bg black -fn fixedsys -fb fixedsys -tn cygwin -e bash --login -i
Mintty is a terminal emulator for Cygwin and MSYS. In Cygwin, it is installed as the default terminal by Cygwin's setup.exe. In MSYS, the mintty package can be installed with the command mingw-get install mintty. Alternatively, binaries for Cygwin 1.7, 1.5 and MSYS can be found on the Minitty downloads page.
Related
I started using Linux Subsystem for Windows, and it is Rad! But, it is running in a terminal which behaves like cmd.exe (yuk!). This carries with it everything I hate aobut cmd. e.g., copy & paste, window sizing, etc.
I don't know how in 2018, Microsoft has allowed this to still exist.
Here are some alternatives:
Alternative Windows shells, besides CMD.EXE?
How do I run Ubuntu, Linux Subsystem for Windows in an alternative command prompt?
Windows cmd is really poor compared to the gnome-terminal or any other *nix-based terminals. Gets really messed up with Linux fonts. Try hyper terminal.
https://medium.com/#ssharizal/hyper-js-oh-my-zsh-as-ubuntu-on-windows-wsl-terminal-8bf577cdbd97
How do I get colorized highlighting on the output?
e.g
npm start
npm test
etc.
System:
Windows 10
Git version 2.16.1.windows.4
Node 5.6.0
Uninstall Git Bash for Windows 10 and run the installer again:
Click next until you'll prompt to choose to Configure the terminal emulator to use with Git Bash, here you select Use Windows default console window (instead of the default option which use MinTTY as terminal emulator)
Click next and finish the installation
Test if it works correctly:
Open Git Bash (cmd will open up), try to use ls you'll see all folder colored in blue
Try some ANSI escape code by running echo -e "\033[44m\033[37m Test \033[0m" you'll se the text Test with a blue background as seen in the screenshot below
Windows 10 Console support 24-bit color and ANSI escape sequences
The terminal was a MinTTY, which does not support colors it seems. Fixed it by re-installing and ticking of Windows Terminal.
For me, it was choosing Windows default console window instead of MinTTY that made color output not working.
My solution:
Uninstall git bash; during installing, choose MinTTY (the default option).
After installation, head over to C:\Program Files\Git\etc, open your git bash
vim ~/.bashrc (for some reason using an editor doesn't work; I guess it's a privilege issue)
Under # Add colors to 'ls' change it to
alias ls='ls --color=auto'
Then restart and it should work.
My version: git version 2.24.1.windows.2
Use winpty
Windows Git Bash has some documented quirks: Winpty and Git Bash
$ winpty npm start
winpty: error: cannot start 'npm': Not found in PATH
Again another windows / git bash quirk, it doesn't attempt to resolve executables ending in .cmd so it needs a nudge.
$ winpty npm.cmd start
The same applies for yarn with:
winpty yarn.cmd start
While we are here and you are having trouble getting gyp to locate your Python2 install location to compile native extensions then try this:
env PYTHON=/c/Python27/ winpty yarn.cmd install
Git Bash overrides your PYTHON environment variable for only the duration of this command. You get winpty to run the pseudo-tty session to allow animation rendering and coloring.
Assuming your python 2 install location is C:\Python27
I have a bash script that runs screen and uses $( command ) to execute the output of command. I need to port this script to run on Windows. I installed Cygwin to run this but it doesn't recognize screen as a command and I don't know the Windows equivalent of linux's $(). Any suggestions on how to do this in windows?
screen is not installed by default.
You need to explicitly install it using cygwin setup.
https://cygwin.com/faq.html#faq.setup.what-packages
$( command ) it is available in bash on Cygwin like on Linux
I've just installed cygwin (64bit) terminal on Windows 7 64. When I open cygwin terminal from Start menu, I can only see empty terminal window with blinking cursor. I can issue commands and see output, but prompt is missing (at least $ should be there, right?)
Any ideas how to fix it? It is fresh installation of cygwin on fresh Windows 7 64bit Enterprise.
Start with issuing the command
echo xyz
To find out if you are actually at a blank command prompt. If that responds with the output of xyz then check your prompt with
echo $PS1
And then set it
export PS1='\h \w> '
This should give you a prompt. If the first step itself does not give you a prompt you have other problems.
Another option is to start the bash shell from windows command prompt:
c:>c:\cygwin\bin\bash --login
Assuming you have installed cygwin in c:\cygwin
First,
I'm using window64 too, but it can work with cygwin32, please try with cygwin 32
If not, please try install cygwin again from another miror
I tried on linux and ash from busybox does auto-complete command line... But under Windows 7 when I press Tab it doesn't work. Any idea to make Windows 7 smart? :) Thanks!
Looks like auto-complete is done, but nothing echoes back after when tab is pressed...
An example:
adb shell
ls m[press tab]
after tab is pressed, some space characters are shown, but characters that are generated by auto-complete doesn't echo back, then if I press enter, directory mnt is listed which means auto-complete works but echo system has some problem. Right?
ls m[space][space][space][press enter]
mnt
I run adb on Win7 sometimes, both under the cmd.exe and Cygwin, and I was frustrated by how adb shell handled autocompletion and character echo. I also use adb under OS X and Linux, and in both of those environments the autocompletion and character handling works as I expect. What the problem on Windows seems to be is that adb shell is not setting the terminal modes (stty/termio() for UNIX-type shells). I came up with the following workaround that seems to work well for Cygwin's bash shell. I don't know Windows well enough to know if there is a similar command to stty for cmd.exe:
$ stty -icanon -echo -echoe intr ^0 ; adb shell ; stty sane
Of course you can put this in a script.
I believe that the reason that recompiling adb under Cygwin fixes this issue (under Cygwin) is because the recompile causes adb to use the termio() calls to setup the local terminal modes so that they don't interfere with what you type to the Android shell.
Solved this problem by recompiling adb under cygwin. :)
You can use ADB enhanced Putty
It support auto complete and coloring
you can download it from
ADB Putty
read more at ADB enhanced Putty (replacement for "adb shell" command)
Auto-complete is controlled by the following Registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
Set the value to 9 or 40.