I am running Windows 10 on my Surface Pro 3. I installed Cygwin and also added some useful packages (gvim, nedit, emacs, vim, g++). However, when I run gvim, I get "Can't open display". The same thing happens with nedit. When I did echo $DISPLAY, I showed nothing so I set the DISPLAY to :0.0. I still get "can't open display." I tried removing cygwin and re-installing but I get the same problem.
At the heart of the Cygwin collection of tools is the cygwin1.dll dynamic link library (DLL). The DLL serves as an emulation layer that provides Portable OS Interface, or POSIX, system call functionality. The Cygwin distribution also has a large collection of free tools, including most GNU and many Berkeley Software Distribution tools, along with an X server and a full set of X applications.
I would like to monitor processes from a cygwin shell, using top or a variant. The reason for this is its realtime reporting and constant updates. However under cygwin, top will not report on windows processes.
You have to install the procps library for cygwin, this includes the top program, however that will only list processes running in cygwin. If you want to see all processes running on windows, refer to this answer: -top-command-see-processes-for-all-users
If you have a Windows program that is a subprocess under a cygwin bash process you can use taskkill /F /PID [the cygwin process id] /T to kill the process tree, no need to get the Window PID from ps with awk etc.
This is tested under Win7 x64.
I had a more challenging situation than most answers considered: killing the Windows process by executable name (node.exe) was too broad so I had to find the WINPID by looking at the command line arguments. And unfortunately, the cygwin ps command doesn't show commandline arguments.
As an aside, you can find command line arguments for your visible cygwin processes by running this: grep -a "" /proc/*/cmdline xargs -0 But that didn't help me in this situation because the process I wanted to kill wasn't visible by cygwin and therefore wasn't in that output.
Fortunately, Windows (10, at least) comes with a command line tool you can run in cygwin to get command name and argument information. Here's how: wmic process get ProcessID, Commandline /format:csv. The output looks something like this:
Other answers here claim you can /bin/kill -f $WINPID those, but when I tried, it reported this error: kill: illegal pid: $WINPID. I suspect this has something to do with cygwin not running in administrator mode?
I decided to post this as a separate answer because, in my humble opinion, the information that led up to this line is just as valuable as the answer itself: it provides a variety of ways to get the Windows PID from cygwin even if the process isn't visible in cygwin.
Could y'all update the wiki to include a Windows 10 instead of Windows XP graphic? I've got cygwin installed and have placed the cdo.exe file in my windows/system32 folder and still can't get CDO to install per the instructions.
The time came for me to upgrade from cdo 1.6.9 and I am hitting an issue in getting the 64 bit windows cdo.exe to run. When I run ./cdo.exe there is simply no output at all - no errors are reported, but no output either.
When I try ldd ./cdo.exe I get the output as shown in the attached. What I notice is that the linked cygwin paths are all in /usr/bin/, but in my cygwin install there is no such directory. Instead my cygwin installation has all the linked dlls in /bin. Could this be an issue?
I will check thw binary again on my windows box. could be that thw cygwin installation on the huilding machine needs an update. in general it dosnt matter where the dll are, but not getting any output is weird.
I am attempting to install root on my windows 10 laptop. Unfortunately the laptop does not support virtual machines so I will have to use cygwin. I found this guide on how to install root with cygwin.
I currently have a project with a workflow that uses pandoc in its Makefile to convert text from Markdown to LaTeX to PDF. This requires that a LaTeX engine be present in my path, or specified with the --latex-engine option. The rest of my development is done in cygwin64 on 64-bit Windows 7.
It's worth noting that running pandoc main.tex -o main.pdf from the Windows command line seems to work just fine, and gives no UAC prompts. Ideally, I would like a solution where I can run the same installation just as easily from either the Windows or cygwin command line, but being able to run it from cygwin is a must for my workflow (i.e., answers along the lines of "Why even bother with cygwin?" are not acceptable here). It seems there really ought to be a simple way to make this installation available to cygwin.
The key here is that I gave the full path for MiKText's pdflatex.exe in the --latex-engine key, in quotes, using the windows path (as the pandoc I installed is the windows pandoc, it requires windows-style paths to find resources).
Thanks to Ulrike Fischer's comment, I realized that trying to get the Windows-based MiKTeX installation to play nicely with the cygwin-based pandoc installation was a fool's errand. Best to keep those things separate.
So if you put cygwin1.dll in c:\ocaml-stuff, then /tmp corresponds to c:\ocaml-stuff\..\tmp, i.e., c:\tmp. An easy way to understand this is: in Cygwin, cygwin1.dll expects to live in /bin, so /tmp corresponds to a sibling subdirectory. So one option is to create this tmp directory: your OCaml executable will happily use that.
Select where you want the Cygwin directory and all of its support files and binaries to be installed. The default is C:\cygwin64, but I change it to C:\cygwin to make future me a little happier. I also allow all users to have access to Cygwin.
Finally, you're at the package selection screen. If you select nothing and continue with a default installation, you get a full complement of *nix commands in the C:\cygwin\bin directory. They're too numerous to list, but it's a list of standard commands.
For the best results, you need to add the C:\cygwin\bin directory to your PATH environment variable. To set the System PATH to include your Cygwin bin directory, search for "environment" and select the Control Panel option, Edit the system environment variables, when it appears. Select Environment Variables on the System Properties screen.
On the Environment Variables screen, select Path from the System Variables pane, and click Edit.... Click New. Enter C:\cygwin\bin into the field and click OK when finished. Click OK on the other screens to save the entry and to close the System Properties window.
Familiar directories such as /, /usr/bin, and /usr/lib exist under C:\cygwin with the C:\cygwin directory as /. If you don't understand this layout, open a separate CMD window and CD into the C:\cygwin directory and look at the directory in both CMD and in Bash.
So, you see from these anomalies that Bash on Windows is not 100 percent equivalent to *nix Bash. Some scripts will translate directly, while others will have to be Window-ized. That is to say, customized to accommodate path differences, mount differences, and some file location differences. One really cool aspect of hybridizing your Windows environment is that you can also use Windows command line commands. You can pretty easily integrate them into your scripts. Remember to provide the full path to the executable in Cygwin format (/cygdrive/c/windows/system32/blah.exe).
Cygwin is an excellent cross-platform toolset, especially for those of you who must work in a heterogeneous environment, as most of us do. I can't count the number of times I've typed ls, or some other Linux command, in a CMD window only to have it fail. Cygwin gives you the expanded capability of writing a script once and being able to use anywhere, with minor tweaks. Imagine the possibilities. Now, add Ansible to the mix and again imagine the possibilities. To further enhance your happiness, all of the executables under C:\cygwin\bin that have a .exe file extension can also be run in a CMD window without requiring you to be in Bash. Interesting? I thought so.
It consists of a DLL (cygwin1.dll), which acts as an emulation layer providing POSIX system call functionality over Windows. With Cygwin, users have access to standard UNIX utilities, which can be used either from provided bash shell or through Windows Command Prompt.
here is a protip. You can use Windows Terminal or Cmder with Terminus. Just set bash or in your case, cygwin as the default shell for the program. See the readme from the terminal plugin, so you get the idea.
PART I
Here is what I would do in your case. Download cmder mini. It is portable. If you want a faster way to download and manage updates, use chocolatey or scoop. Both are package managers for Windows. There are instructions in the cmder github on how to set cygwin as the shell.
MinGW-w64 (short for "Minimalist GNU for Windows") (@ -w64.org/), is a minimalist (i.e., small but fewer features compared with cygwin) development environment for native Microsoft Windows applications, in particular: