I have been working in *nix environment for quite sometimes, most of embedded system nowadays build on top of Linux along with *nix toolset, for me it’s with BusyBox, minimal *nix stripped down toolset dubbed by the author addresses as The Swiss Army Knife for Embedded Linux, which is true in tight constraint nature in embedded “pocket” size. We have to live in that world, a lot of limitation and we need to overcome it with right mindset.
The main part of the problem is that *nix is not my main development machine, company as an enterprise still cannot get rid of Windows as it’s main OS, there’s already lot of bits spilled explaining why about it, I’m not gonna pour another bits for that. I will have to embrace it like a proper engineer, if there is a problem we have to come out with solution or workaround. To get access on *nix environment I use puTTY and SSH it, to have an alignment of environment from Windows OS Cygwin is the answer.
Here is steps that i would do to setup Cygwin, do it! explanation come later, just 1-2-3.
- Download Cygwin
Run the setup executable (later Windows OS need to “Run as Administrator”), next, next, and select closest download site from where you reside to get faster installation
select package for your development, gcc in this example, (totally different topic, but please select Vim as well). Ceveat: read the 2nd step ;).
Choose to include it with windows environment variable. That’s it.
- Ditch Cygwin
Yes, you read it right. Ditch cygwin.
Select Mintty in the setup package. If you have finish cygwin setup, don’t worry, run the setup again and select Mintty from packages to install menu.
Go from explorer to
c:/cygwin/binyou’ll find mintty.exe create shortcut and pin it to start menu.
On this newly created Mintty shortcut (right-clicked) change it’s properties, add it with
-e /bin/bash --loginso it become
C:\cygwin\bin\mintty.exe -e /bin/bash --login
The changes is to read ~./bash_profile when we start Mintty, this will give us linear behavior between Cygwin and Mintty, but Mintty is our primary choice.
- Solarized it
We don’t have mintty config, let create one
vim .minttyrcor with your favorite editor (we can go to explorer and edit the file)
Go to mintty-colors-solarized select .minttyrc–solarized-dark copy paste it to
It didn’t stop in here, solarized the directory list as well.
Go to dircolors-solarized select dircolors.ansi-dark copy paste it to
.dir_colorsI know that color is personal choice, however since solarized is so popular it’s theme is ubiquitous in text editor, here we can have linear color theme everywhere.
- Bash apply and alias
to apply directory color…
eval `dircolors ~/.dir_colors`
and its alias…
alias ls="ls --color"
optional, another my ‘must have alias’ (after put 2 line above) is
alias ll="ls -l"
ls will have color, and ll will have additional -l. It can combined with -a,
ll -ato list all file with long format in color.
So why select Mintty ? if you have work in cygwin and PuTTY then you know the difference, there is list of limitation with cygwin console, but my most annoying part working with cygwin console is the resizing window console will broke output format.