swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

Create page discussing pros and cons of various approaches to shell on Windows #140

Closed gvwilson closed 10 years ago

gvwilson commented 10 years ago

We need a summary page summarizing experiences/pros and cons of various approaches to running things on Windows.

DamienIrving commented 10 years ago

The default software installation instructions for bootcamp websites suggests that people install Git Bash. Does that mean we currently think it is the best option? (and obvious bonus being that you get git with the same install)

wking commented 10 years ago

On Mon, Nov 11, 2013 at 01:45:22PM -0800, W. Trevor King wrote:

On Mon, Nov 11, 2013 at 01:57:44PM -0500, Aron Ahmadia wrote:

The alternative we normally suggest for Software Carpentry, msysgit, contains bash and Git for sure, I don't know if it has Make: http://msysgit.github.io/community.html

It does:

https://github.com/msysgit/msysgit/blob/master/bin/make.exe

Looking in the bin/ directory shows a bunch of other things if you're interested:

https://github.com/msysgit/msysgit/tree/master/bin

Cross-posted from discuss@ 1.

wking commented 10 years ago

On Mon, Nov 11, 2013 at 02:32:52PM -0800, Damien Irving wrote:

The default software installation instructions for bootcamp websites suggests that people install Git Bash.

Also, I think “msysGit” is clearer than “Git Bash”, because:

  1. There's already enough naming confusion in this area 1.
  2. You get a lot more than Git and Bash 2.
ahmadia commented 10 years ago

Also, I think “msysGit” is clearer than “Git Bash”

+1, I think it's a silly capitalization choice but I agree that we should use the project name.

jiffyclub commented 10 years ago

We have been preferring msysGit in boot camps largely based on its simplicity for installation and use. I think our only real complaint is that it doesn't come with a simple command line text editor like pico or nano.

wking commented 10 years ago

On Mon, Nov 11, 2013 at 02:44:30PM -0800, Matt Davis wrote:

I think our only real complaint is that it doesn't come with a simple command line text editor like pico or nano.

And on this front we've had a simple workaround since swcarpentry/boot-camps#47 (#89), which landed in boot-camps/master on 2013-03-21.

embray commented 10 years ago

I use a combination of MinGW/msys and Console 2, and that's carried me a long way. I'm still not crazy about Console 2 but so far it's been the only viable option for a UNIX-like terminal emulator on Windows. Most of its faults are not even really its fault so much as Microsoft's. I still haven't tried Power Shell , but that's not going to give a UNIX-y environment either. In any case, I've gotten to a point where I'm pretty happy using Windows as a desktop environment for day to day work while still not giving up my bash shell and GNU utils.

I've had an item on my TODO list for over a year now to write up instructions for how I set up Windows environment, but it's one of those things that keeps slipping. Hopefully I can contribute some of that here...

joonro commented 10 years ago

I use powershell + ConsoleZ (https://github.com/cbucher/console), which is an improved? version of Console 2. I install Git (for Windows) but I mainly use powershell instead of bash. Powershell has pros and cons over Bash but I think going native is better in the long run.

Also, I think ConsoleZ (or Console 2) should be included as standard Windows devel setup. It is so much better than the default cmd.exe window. For powershell only, Windows PowerShell ISE looks good too. (And it has some fancy auto-completion feature as well)

ethanwhite commented 10 years ago

My experience with Cygwin in both SWC bootcamps and my university courses has included a reasonable number of installs that were broken in some way (including installs on older architectures that we could never get to work) and confusion over the more complicated install. Since switching to msysGit I've seen zero issues in both bootcamps and classes.

joonro commented 10 years ago

I agree - I don't think Cygwin is the way to go.

jdblischak commented 10 years ago

Git Bash

Pros: Easy installation of both Bash and Git for Windows. Cons: Difficult to copy-paste. Doesn't have man or nano, but @ethanwhite's nano installer fixes this (though I've never field tested the nano installer at a bootcamp so I cannot comment on whether students struggle with this fix).

jdblischak commented 10 years ago

Another feature of Git Bash worth noting is that it displays the current branch of the git repository in the command prompt. This can be distracting for Windows users during the shell lesson, especially since the instructor is unlikely to have a similar command prompt. On the other hand, it is useful when teaching branching.

ethanwhite commented 10 years ago

Another feature of Git Bash worth noting is that it displays the current branch of the git repository in the command prompt. This can be distracting for Windows users during the shell lesson, especially since the instructor is unlikely to have a similar command prompt. On the other hand, it is useful when teaching branching.

This is behaviour that we could easily modify in the windows installer (it should just be some prompt changes in (.bashprofile) if we collectively think it gets it the way.

rhiever commented 10 years ago

I'd like to pipe in and suggest cygwin for the default Windows shell install again. As noted above by @jdblischak, git bash lacks several basic commands including man, nano, and whoami. I understand we have a nano installer that is reported to work well, but what about these other commands? It's a constant awkward encounter when students on Windows report that these commands don't work. OTOH, cygwin has all of the commands we use in a SWC boot camp.

I'm curious: What has been difficult about installing cygwin? IME with several people it's been a simple double-click install process. Specifically, where has it failed? How could those failures have been diverted (i.e., how can documentation prevent it)?

ethanwhite commented 10 years ago

I'll add a touch more historical perspective and then leave this up to others to figure out. Back in the old days we used to have a lot of problems with cygwin installs. They would sometimes fail entirely on older versions of Windows (which we had plenty of at bootcamps), and the default installs regularly didn't come with crucial things installed like svn and nano. Even if you gave folks clear instructions a number of them wouldn't successfully navigate the somewhat complicated process for installing these things. This meant we spent a lot of time on the very first morning fixing installation issues. This was one of the core reasons that there was serious talk of not supporting Windows at all at bootcamps (i.e., making Windows users use Linux virtual machines instead). This is why I went looking for an alternative and came up with msysgit. Yes, it's missing a couple of commands, but we solved the nano issue (and we've now done this for systems without Python thought there may be a touch of debugging left to do) and the other commands have generally been easy to avoid. The key was that it just worked and all of a sudden we weren't debating dropping Windows support any more.

Of course in that time it's possible that cygwin has gotten more stable and has better defaults, in which case I don't have any conceptual objection to switching back. But I think we'd first want to trial run it at some novice bootcamps to make sure that it's just a seamless as our current msysgit approach. In my opinion the most important thing isn't whether it's a full *nix environment. It's how pain free it is for beginners using it for the first time.

The other major issue with cygwin is the native directory structure. You don't start anywhere near a natural part of you file system so Windows students have to be taught to do something different and remember the whole /cygdrive thing. This isn't the end of the world, but it's a lot more difficult than the current cd Desktop that we use for kicking things off.

rhiever commented 10 years ago

Thank you for adding a historical perspective, @ethanwhite. I just checked and it looks like cygwin is still actively being updated, so maybe it's worth conducting some experiments at a boot camp or two.

joonro commented 10 years ago

I wonder if we need to require participants to install cygwin for a couple of unix commands. (Also, there is native whoami since Vista :)) Except shell, what other parts of bootcamp lessons have problems with native Windows setting? I feel using cygwin adds unnecessary complications such as /cygdrive @ethanwhite mentioned, which will confuse many participants who do not have any experience in command line. Some other confusions I saw was python shell not running correctly in cygwin (see http://stackoverflow.com/questions/3250749/using-windows-python-from-cygwin) and some people did not understand package installation procedure and just checked everything to install, etc.

Also, if majority of participants use Windows machines, shouldn't we try to make things run more natively in their computers?

wking commented 10 years ago

On Fri, Jan 24, 2014 at 08:56:34PM -0800, Randy Olson wrote:

I'm curious: What has been difficult about installing cygwin?

To fill in the historical perspective, I filtered my SWC archives for “Cygwin” and pulled out these:

Note that I was searching for “Cygwin”, so issues with msysGit / Git Bash (like https://github.com/swcarpentry/bc/issues/234#issuecomment-33055444) won't turn up.

lexnederbragt commented 10 years ago

I came across something on twitter that may perhaps be of relevance: How to access Windows through ssh.

ahmadia commented 10 years ago

With a few more Windows bootcamps under my belt, I'm starting to swing towards Git Bash as our recommended default. Users already comfortable with Cygwin will be able to follow along, but the filesystem mapping is much easier to parse for Windows users in Git Bash, and since this is one of the very first topics we teach, it's important to make this introduction as gentle as possible.

ethanwhite commented 10 years ago

With a few more Windows bootcamps under my belt, I'm starting to swing towards Git Bash as our recommended default. Users already comfortable with Cygwin will be able to follow along, but the filesystem mapping is much easier to parse for Windows users in Git Bash, and since this is one of the very first topics we teach, it's important to make this introduction as gentle as possible.

+10

jkitzes commented 10 years ago

+1. My last 3 bootcamps all had Windows users running our recommended Git Bash and windows installer script, and we had zero issues with this setup (for those who followed the instructions properly).

I have come across two complaints, however -

  1. You can't copy and paste in the Git Bash window, which is a pain when you're trying to grab a config option from the website and paste it into your terminal windows, for example.
  2. Apparently there's no .bash_history created in any obvious place by default (had a few students who wanted a record of the commands they had run during the bootcamp for later reference). I couldn't find any fast way to help on the fly - I've Googled several possible solutions but I don't have a Windows box to check them on.
embray commented 10 years ago

@jkitzes You can copy/paste into a Windows cmd.exe console--it's just a pain. To copy you have to right click the title bar and find "Mark" in the menu. Then you can use the mouse to select text--anything you select is automatically copied. Why Microsoft has not updated this terrible program after however many decades is beyond me.

In the options menu for cmd.exe you can also select "QuickEdit mode" which enables text selection by default, so that's worth mentioning too. But most users are not going to have this selected by default.

Pasting is mercifully easier--there's a menu item for it, but you can also just hit the Insert key.

joonro commented 10 years ago

@jkitzes That is one of the reasons why we should include better terminal emulator in installation for Windows in my opinion. ConEmu (my new choice) or ConsoleZ will be way better than cmd.exe.

embray commented 10 years ago

I've been using Console2 for a while but have mixed feelings about it. I haven't tried ComEmu or ConsoleZ, but Ill have to check them out. But yes, cmd.exe is a terrible thing to put learners in front of.

joonro commented 10 years ago

I used ConsoleZ (fork of Console2 similar with some improvements) for several months before I switched ConEmu. I prefer ConEmu, but for a beginner, this might be too developer-like with a lot of options.

gvwilson commented 10 years ago

See #379, which incorporates conclusions from this discussion into the teaching notes.