Cygwin uses Unix paths. It can be sometimes confusing to figure out where in the Windows filesystem a Cygwin path is actually referring to. This is precisely why Cygwin ships with the cygpath tool.
- To print the Windows path of a Cygwin Unix path:
$ cygwin -w /some/unix/path
- To print the Windows path of a Cygwin Unix path in a DOS-compatible path format:
$ cygwin -d /some/unix/path
- To find out how a Windows path can be accessed inside Cygwin as an Unix path:
$ cygwin -u "C:\Windows"
I installed the latest stable release of ConEmu. I opened a Cygwin shell and used SSH to connect to a remote computer. I ran Byobu on the remote computer. I noticed that its status bar would shift upward, overwriting the entire screen after some time.
This problem is documented here. The solution suggested by the ConEmu creator is to use the ConEmu/msys terminal connector plugin. Using this connector is however a bit complicated. But, according to this post, it has been rolled into ConEmu starting with the 170705 release. I checked and found that the stable release I had installed was 161206. The stable release was years behind!
Seeing no recent stable version available, I opted to download a preview release from here. This release was dated later than 170705. byobu worked fine through SSH from Cygwin after that!
The command is the same as what you would use to find the version of the kernel on a Linux system:
$ uname -r
Another method is to check the version of the cygwin package:
$ cygcheck -c | grep cygwin
Tried with: Cygwin 2.10.0-1 and Windows 10
Byobu is a user friendly terminal multiplexer built around tmux.
There is no byobu package in Cygwin, but installing it from source is easy:
$ ./configure --prefix="$HOME/installs/byobu"
$ make install
- Add the installed
bin directory to your
PATH environment variable at the shell or permanently in your bashrc:
$ export PATH="$HOME/installs/byobu/bin:$PATH"
You can now run
byobu at the shell. You will notice that there will be some errors when it looks for Linux programs that are either not installed or not available on Cygwin. Also, the configuration user interface does not appear since that needs
python-newt which is not available for Cygwin. Some of the function key combinations might also not work cause it is Windows.
Tried with: Byobu 5.125 and Cygwin 2.10
The first time you try to install a Perl package from CPAN, you might get this error:
make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
The fix is simple: you need to install the make package. This error typically occurs on Cygwin, which does not have make installed by default. Install make and then try to install the package again and it should work now.
Tried with: Cygwin x86 1.7.25
Probably the biggest pain in using Cygwin is that you need to use the setup GUI program and go through its wizard dialog to view, install or uninstall packages. Thankfully, there is now a solution called apt-cyg that mimics apt-get on Linux to list, install and remove Cygwin packages.
To install apt-cyg, first install the
wget packages using the setup program. After that do:
$ wget https://raw.githubusercontent.com/transcode-open/apt-cyg/master/apt-cyg
$ install apt-cyg /bin
You are now ready to use apt-cyg, which is actually a Bash shell script.
This is really easy:
$ apt-cyg update
(Update package information from the internet)
$ apt-cyg show
(Lists installed packages)
$ apt-cyg find foo
(Lists installed and not-installed packages with foo in their name)
$ apt-cyg describe foo
(List description of package named foo)
$ apt-cyg install foo
(Install package named foo)
$ apt-cyg remove foo
(Remove package named foo)
Tried with: Cygwin 2.10.0
I had a Cygwin installation on Windows x64. Recently, I found that its setup program could not pull the package list, claiming that the mirrors could not be found. It turns out that now Cygwin has split off into x86 (for 32-bit Windows) and x86_64 (for 64-bit Windows).
I tried the x86_64 and found it lacking many packages that are present in the x86 branch. In addition, there were many other problems too. So, if you are using a production system based on 64-bit Windows, you might still want to use the x86 Cygwin. Both of them work on 64-bit Windows, but the x86 version is bound to have fewer problems in the near future, until x86_64 version gains stability.
Vimrc and other Vim script files can be used across many platforms. To check specifically for Cygwin in these files, check for win32unix as shown here:
" Do something only in Cygwin
Note that value of unix is also true under Cygwin. So, if you want to do something specifically under Linux, but not under Cygwin, then try this:
if has("unix") && !has("win32unix")
" Do something only in Linux, but not in Cygwin
Tried with: Vim 7.3 and Cygwin 1.7.22
The cygcheck command can be used to list the installed packages in Cygwin:
$ cygcheck --check-setup
$ cygcheck -c
Tried with: Cygwin 1.7.22
cowsay is a popular tool to produce fun greetings at the shell. Cygwin does not ship with cowsay.
A cowsay package compiled for Cygwin can be downloaded from here. Unzip its contents, which will be contained in a usr directory. Using Windows Explorer, merge this directory with the /usr directory of Cygwin. Using the mv command for this purpose will not work, since it does not merge directories.
That is it, you can call cowsay or cowthink from the Cygwin command prompt! The different ASCII animal characters it ships with can be seen in the /usr/local/share/cows directory 🙂
Tried with: Cowsay 3.03-1 and Cygwin 1.7.22