Cygwin not working on Windows 10 (even after added to system's PATH) - cygwin

I recently downloaded and installed Cygwin on my 64-bit Windows 10 computer. I'd like to for Cygwin to work with the normal Windows command prompt. Per instructions I found online, I added the path to the Cygwin executable to my system's PATH:
Advanced System Settings -> Environment Variables -> appended ;C:\cygwin64\bin to system's Path
Unfortunately, Cygwin still doesn't work on Windows command prompt. Any suggestions?

You will not be able to make use of all Cygwin functionality at the Windows command prompt. Some limited use of commands -- specifically those commands that exist as binaries in the C:\cygwin64\bin directory, and don't rely on any kind of shell support -- will work. But since your're not running a shell when you're in a Windows prompt, the associated support normally available to you in a Cygwin native command window will not be there.

Related

How to open VSCode from a Windows Linux Subsystem?

I have VSCode installed on my host OS which is Windows 10 on which I have an Ubuntu Subsystem terminal (WSL) and I'm trying to open VSCode from whitin it with this command code . The problem is that the output is Command 'code' not found. How can I make this work?
Assuming you have installed VSCode in its default place, then in WSL you can do :
PATH="$PATH:/mnt/c/Users/your-user-name/AppData/Local/Programs/Microsoft VS Code"
and run code.exe .
First, try installing the Remote - WSL extension in VSCode (or the meta Remote Development extension pack, which includes the WSL work).
I doubt that's your main problem, but it could help.
Next, try running code . under PowerShell - Does that work? If not, then VSCode isn't in the Windows path. Try reinstalling it -- If it's not in the path, some other associations may not be correctly installed either. I don't recall if there's an option during installation to add or not add it to the Windows path, but if so, it could be that it was deselected during installation.
If it does launch in Windows, then obviously it's in the Windows path. By default, WSL appends the Windows path to the default path in Ubuntu during init. So (again, by default) code . should work in WSL if it is working under PowerShell.
Check your $PATH under Ubuntu (echo $PATH). Is the .../Microsoft VS Code/bin directory (wherever it is installed) in the path? If not, then WSL may not be doing its default append. Edit /etc/wsl.conf under Ubuntu and look to see if there's an [interop] section, as in:
[interop]
appendWindowsPath=false
If so, then change it to true (or, delete it entirely) to allow WSL to add the Windows path. While it's the default setting if missing, you might try adding it and setting it to true (although that shouldn't have any effect).
If that still doesn't work, then check your startup scripts (e.g. .profile, .bash_profile, .bashrc) to see if there are any modifications to the PATH which could be causing this problem.

How to open a VS Code IDE from Linux subsystem on Windows?

I'm running a Linux subsystem with an Ubuntu terminal inside Windows 10 - I wanted to make use of the functionalities of both operating systems without partitions or virtual machines.
In an Ubuntu terminal on Linux, I use the command 'code .' to open up the VS Code IDE but it doesn't seem to work when the terminal is part of a subsystem on Windows.
I can open up the IDE from Windows 10 and set my path into the Linux system but I remember reading some guidance that it's okay to save files from the Linux onto the Windows side but not vice versa.
Any solutions are much appreciated, thanks in advance!
If you wish to invoke windows binaries from WSL (Windows Subsystem for Linux) like for the example you want to run visual-studio-code, you can do so by setting your visual-code's installation directory into your %PATH% system variable and invoking it using this way
$ [application-name].exe notice the .exe is important.
And this interoperability is added in the Fall Creator Update of windows.
You can follow this documentation from Microsoft for more help.

Open TCL pipeline to cygwin running terminal

So i'm running a TCL program in Windows. Is there any way to write directly to my running Cygwin terminal? Assuming my TCL workspace is currently in C:\workspace and cygwin installation is C:\cygwin\ and windows cannot see private Cygwin files for example inside /dev/pty0 .
Without having a copy of Cygwin handy to check, I can't be certain, but I understood that files in C:\cygwin were visible to both Windows and the Cygwin terminal. So try writing to a directory under C:\cygwin from your TCL program. Then you should be able to read and display that file from Cygwin.
Alternatively, isn't Cygwin able to see the entire Windows file system, as per this example?

Cygwin terminal crashes

I installed Cygwin on windows 7 64 bit ultimate and after starting cygwin terminal it crashes and creates a file named mintty.exe.stackdump, and in this file there is a line i.e
Exception: STATUS_ACCESS_VIOLATION at eip=61004DF6
After searching it on google; it seems that this exception occurs if their are two cygwin1.dll in system. There is only one that is inside the installation directory of cygwin.
I had installed mingw, but even after uninstalling mingw it still crashes. I didn't worked on cygwin before can anybody guide me how I could get rid of this problem
cygwin1.dll gets installed by some other programs that get ported from Linux to Windows, such as OpenSSH. It's possible that you have another version of it somewhere else on your system that was installed by a different application.
It doesn't necessarily need to be in your Cygwin install dir either. Just being in a directory that's in your PATH env variable, for instance, would be enough for it to cause confusion for Cygwin.
If you know exactly of a likely culprit (think Windows ports of traditionally Linux programs and tools), I would check those first. Otherwise, try digging in the different directories in your path var (you can see them by firing up a cmd.exe terminal and running the command echo %path%).

How to make a symbolic link with Cygwin in Windows 7

Recently I have tested to write an Android application with native code in C/C++. The problem is in making symbolic links when using the Android NDK. After some googling, some say to use Cygwin. I have installed it now. How can I make a symbolic link with Cygwin in Windows 7?
In short, define the following environment variable:
CYGWIN=winsymlinks:nativestrict
According to Cygwin documentation:
If set to winsymlinks:native or winsymlinks:nativestrict, Cygwin creates symlinks as native Windows symlinks on filesystems and OS versions supporting them.
The difference between winsymlinks:native and winsymlinks:nativestrict is this: If the filesystem supports native symlinks and Cygwin fails to create a native symlink for some reason, it will fall back to creating Cygwin default symlinks with winsymlinks:native, while with winsymlinks:nativestrict the symlink(2) system call will immediately fail.
You should also make sure you run Cygwin with elevated privileges (right-click the shortcut and choose Run as Administrator, or set the mintty shortcut property, Advanced → Run as Administrator).
Some details are provided in the other answer.
I got it the next day! So, not to wrongly get ignorance thinking like me (newbie to Cygwin), I answer it now.
Making a symbolic link for Windows 7 is easy with the usual command:
ln -s
The answer is setting up Cygwin with the required packages such as make, etc.
Read the requirements clearly: Android NDK
You may try to use "mklink" instead of "ln -s" as Tony O'Hagan suggested in an answer to Git Bash shell fails to create symbolic links.
We had a similar problem and had a solution not documented in previous answers.
We needed a way to create a directory remote link that worked for both Cygwin and Windows 7 to a remote Samba (Linux) share.
We used this command in Windows PowerShell and it worked.
CMD /C MKLINK /D C:\local_dir_path\dir \\\\192.168.0.1\remote_dir_path\dir
The above command makes a link that works in both.
Of course, please change the local and remote directories to meet your needs.
ln -s works in Cygwin, but not Windows.
Using a "make link" command in Windows Explorer (folder view) worked in Windows, but not in Cygwin.
A similar command as above entered in Cygwin did not work and we didn't completely understand why. Perhaps it is related to conversion of strings or paths.

Resources