Windows 10 shell environment



  • I'm back on my fresh Windows 10 install, I need to finish setting that up before I get back to OS X (and audio players).

    I'm at a point where I need to set up some kind of terminal + shell + git support.

    Last time around, I was using a lightweight bundle of GNU-like utilities (gow), cmder terminal emulator and TortoiseGit using putty keys for SSH connections.

    I'm naturally always looking to upgrade, but boy, is finding current information on this a chore. Articles like this have left me even more confused. Add to that new Windows 10 terminal improvements, and I have no idea which way to turn. Why does being a Windows hipster have to be so freaking hard?!

    Anyway, I don't really need some great shell support, since I'll be doing most of my work on Linux VM-s anyway. So I'll probably just end up going with gow + cmder (or even native shell) again. But if someone has a better idea or suggestion, let's hear it.



  • @cartman82 said:

    terminal + shell + git support

    1. Install GitHub desktop
    2. Set shell type to "git bash"
    3. Right click on any repo and click "open shell"
    4. $

  • sockdevs

    PS C:\> choco install cygwin cyg-get
    PS C:\> cyg-get git ssh
    

    it's my goto for shells in windows b/c i don't have to think about the difference between windows and *nix (most of the time)

    /me bookmarks this thread in case a better idea emerges



  • Hmm, I seem to remember you get basically like a little chrooted environment, where your home is Git folder, and your other directories appear mounted on something like /Volumes/c/Users/Cartman/Stuff.... Correct?



  • @accalia said:

    PS C:> choco install cygwin cyg-get
    PS C:> cyg-get git ssh

    Is it still chocolatey, or is everything moving to nuget oneget?

    Another thing that's incredibly confusing in this new W10 landscape.



  • @ben_lubar +1

    @cartman82 said:

    Hmm, I seem to remember you get basically like a little chrooted environment, where your home is Git folder, and your other directories appear mounted on something like /Volumes/c/Users/Cartman/Stuff.... Correct?

    I believe it's a MinGW64 environment or something. I don't really know much about it other than it works. Also, ~ goes to C:/Users/LB/ for me.


  • :belt_onion:

    • I tend to run choco install consolez clink and just use the default windows cmd tab for build processes.

    • Clink extends the default cmd to have Linux keyboard shortcuts and a persistent history. (I like Ctrl-W and Ctrl-U).

    • ConsoleZ allowed freely resizable screen terminals before it was cool to do so.

    • If I need a Linuxy shell I run git-bash as a tab in ConsoleZ (the choco install git.install version). Setting that up is a bit harder though, guess I'll have to dig up my config file.

    • Then again, I do tie things together by using Total Commander as a file explorer. I have all those different command line environments linked to keyboard shortcuts so that I can immediately open a fresh one in the right folder.



  • I concur with Ben, that's by far the easiest way to get a working Git and Unix-ish-kinda shell.



  • Ok, I've been playing with this on and off the whole day, and here are the conclusions so far.

    ##1. Git bash

    • Easy install, everything configured out of the box. You get current git and openssh with no hassle.
    • Works within Windows file system (so my home folder is /c/Users/Cartman, which matches my Windows User folder). To achieve this, it does some strange trick where my drives are available through /c, /d..., but aren't visible through ls
    • ~ leads to my home folder, as expected
    • On the downside, this means the home folder gets polluted by unixy dot-hidden files. It's a trade off
    • I don't see an easy way to install more software. The lack of nano is painful. I'll look more into this, it could be possible some of the cygwin package managers will work.

    ##2. Cygwin

    • Also a nice installer, you can pick what you want installed. They recommend running the installer again to update, but there are better solutions.
    • Its nix environment is entirely separate from Windows. ~ leads to my home inside this chrooted virtual world (different than my Windows C:\Users\Cartman home). My Windows drive is available at /cygdrive/c.
    • This feels too isolated to me. Too much like a virtual machine without any of the benefits. On the upside, it means my real home folder won't be polluted by all the faux hidden files generated by linux utilities.
    • I was able to install a utility called apt-cyg, which allows me to install additional software using familiar syntax (apt-cyg install nano, a life saver).

    Both of these seem to be using the same terminal emulator called mintty. Windows cmd is also an option at least with "Git for Windows". @JBert's clink idea turns cmd into a pretty nifty little shell (on top of W10 improvements).

    Frankly, neither of these are too appealing to me. I'd like something more native feeling, less isolated.

    Next research areas:

    • This question
    • Git bash package managers
    • How to install native ssh to Windows proper, without any of the faux file systems (if possible)
    • MSYS2

  • Winner of the 2016 Presidential Election

    First link on google searching for "git bash windows nano".

    It's about as convoluted as you might imagine for a Linux application :smiley:

    Filed Under: Blakeyrat would not approve the amounts of steps within the command line!


  • :belt_onion:

    @cartman82 said:

    I don't see an easy way to install more software.

    I installed git lfs and it was immediately usable within git bash. So installing more software means just running installers, at least as long as installer is smart.



  • And as of terminal, I recommend ConEmu in place of built-in console. It's simply much, much better. Even with all the improvements made in W10. And you can configure it to use custom shells too (PS, Cygwin Bash, or whatever else you end up with).



  • Wow, there's some drama surrounding apt-cyg utility I mentioned earlier.

    The guy svnpenn seems to have issued a DMCA takedown request against apt-cyg repository.

    https://github.com/github/dmca/blob/master/2016-01-26-apt-cyg.md

    He's now pimping something called sage, which is basically the same bash script, with a different name. Apt-cyg is, meanwhile, back. At least it was working for me.

    What a mess.



  • @Gaska said:

    And as of terminal, I recommend ConEmu in place of built-in console. It's simply much, much better. Even with all the improvements made in W10. And you can configure it to use custom shells too (PS, Cygwin Bash, or whatever else you end up with).

    I know. I was using cmder, which is a customized prettified version of ConEmu.


  • Impossible Mission Players - A

    @cartman82 said:

    issued a DMCA takedown request against apt-cyg repository.

    On what grounds? That he's made the latest changes, so therefore he owns it?
    This sounds like a good cross-post candidate for another thread I remember reading...



  • I thought these things had licenses that edits to public stuff is also public, and has to be made public, and all that jazz.

    I'm pretty sure that there's several open source things that I integrated at my company, that the license said that I could use commercially given that, even if I altered it for a bug fix, I'd have to upload that alteration for public use.



  • I use ConEmu + PowerShell, with [url=https://github.com/lzybkr/PSReadLine]PSReadLine[/url], [url=https://powertab.codeplex.com/]PowerTab[/url] and [url=https://pscx.codeplex.com/]PSCX[/url]. Never felt the need to use coreutils for anything.



  • @CatPlusPlus said:

    with PSReadLine, PowerTab and PSCX

    For a second, I was like "why the fuck do you mention PlayStation emulator in shells topic?". Then realized that I got the order of letters wrong.



  • I've been playing with Msys2 shell, reading articles, etc. I think I've figured it out.

    Git shell seems either a reskin or very close fork of Msys2, both of which are laying on top of combination of Cygwin and MinGW (differences).

    Its decision to base itself in your Windows home folder is basically a configuration switch in file /etc/nsswitch.conf. For details, see here: https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch. This entire article is pretty great, BTW, going into nitty gritty of how they mapped Windows security system to POSIX.

    Its decision to mount Windows drives to /c, /d... instead of /cygwin/c is also configurable.

    Basically, there's nothing git for windows gives you that you don't get with msys2 or base cygwin. Just branding, context menu and a few preconfigured options (not counting the native GUI tools).

    But what msys2 gets you that you DON'T get with "Git for Windows" is pacman, a package management tool nicked from Fedora Arch. Using this, I was able to set up my own git, ssh, editors and everything else I needed. Also, the system seems to be a bit more involved than the simple bash script that was apt-cyg.

    So, this is what I did for now:

    • Ditched "Git for Windows" and "Cygwin"
    • Installed Msys2
    • Configured it to use my Windows home folder (I'll swallow the dot files)
    • Installed ssh, git, etc. All the tools I'm used to.

    I also added its /usr/bin folder to my Windows PATH, so now I can call everything I install there from the regular shell as well. This, for some reason that's blowing my mind, just... works. These utilities are somehow started in the context of msys (or, I guess, cygwin or mingw), even when I call them from normal console.

    Here's a powershell running nano with syntax highlighting (which would be stored in /usr/share in the msys2 chroot).

    Shell pipelines, ssh and everything else seem to work fine, in ordinary cmd too.

    As for the terminal emulator, I think I'll keep mintty for now, as conemu, cmder and babun seem too integrated and opinionated for my taste.



  • @cartman82 said:

    Basically, there's nothing git for windows gives you that you don't get with msys2 or base cygwin. Just branding, context menu and a few preconfigured options (not counting the native GUI tools).

    Yes there is. You run ONE installer, and then it's there and working perfectly.



  • @blakeyrat said:

    Yes there is. You run ONE installer, and then it's there and working perfectly.

    Granted, if you want just git and nothing else, GFW does the job.

    Besides git+ssh, I also want nix command line, nano as editor and a few other things (plus I don't want git branding all over the place), so this suits me better.



  • Nobody wants Git.



  • @cartman82 said:

    But what msys2 gets you that you DON'T get with "Git for Windows" is pacman, a package management tool nicked from FedoraArch Linux.

    Before posting, get your facts straight.



  • @blakeyrat said:

    Yes there is. You run ONE installer, and then it's there and working perfectly.

    I'm pretty sure that <abbr title"I don't remember proper capitalization">msys2 installer has "Install Git" option too...



  • @Gaska said:

    I'm pretty sure that msys2 installer has "Install Git" option too...

    There's no need for it, even if it does.

    You just do

    pacman -S git
    

    And you're set.


  • sockdevs

    @cartman82 said:

    Besides git+ssh, I also want nix command line, nano as editor and a few other things (plus I don't want git branding all over the place), so this suits me better.

    I have to ask, if you want all that, why bother with Windows 10? Just install a Linux or a BSD or something; it'll be easier all round.



  • @RaceProUK said:

    I have to ask, if you want all that, why bother with Windows 10? Just install a Linux or a BSD or something; it'll be easier all round.

    I already have.

    But I need stuff on Windows too. nano, so I don't have to use vim to edit commits. ssh, so I can manage servers without stupid putty. And some nice gnu utilities are always nice to have too (eg. wget, rsync, grep, awk etc.)



  • I love their packaging system where even the command to run it is a trademark violation.

    What the fuck is wrong with open source people?



  • @blakeyrat said:

    I love their packaging system where even the command to run it is a trademark violation.

    Except it's not.


  • I survived the hour long Uno hand

    @cartman82 said:

    nano, so I don't have to use vim to edit commits

    GHFW removes that need too.


  • sockdevs

    @cartman82 said:

    Is it still chocolatey,

    it's what i use.

    oneget is.... interesting still.



  • I have Windows 10 Pro at work and my personal setup is running a Linux VM on Hyper-V (which comes part of W10 Pro) and I use mintty + openssh on Windows to ssh in and then run tmux on the VM. I could reverse the setup any day and get the same results but that's too much of a hassle and the Windows (free upgrade) license is tied to the system.

    This setup gives me one tabbed (tmux) super terminal that I use for anything non-Windows stuff and I don't need to pollute the Windows install with UNIX tools nor I have any limitations what I can run. I also have shared folders mounted on the VM from the Windows machine so I can interop seamlessly.

    The reason why I mintty + ssh in is that using the emulated graphics of a VM is too slow to actually type anything for longer periods of time without going nuts.


  • :belt_onion:

    Cheers. I might set that up on my Windows install at home. Not that I boot into it much, but it would nice to have a proper shell there as needed.



  • >Unix-ported shells
    >Windows

    ... the horrors... the horrors...

    Do you people not care about proper path handling, which both MSYS2 and Cygwin seem to lack, especially when translating command-line arguments from POSIX-style argc/argv arrays to BaseDLL command lines?



  • @hifi said:

    I also have shared folders mounted on the VM from the Windows machine so I can interop seamlessly.

    I found this problematic because of file permissions. Everything you yank through Windows ends up with 777 access rights, which is super annoying for me.

    @hifi said:

    The reason why I mintty + ssh in is that using the emulated graphics of a VM is too slow to actually type anything for longer periods of time without going nuts.

    You just need to pick a desktop with lower graphics requirements. Something that doesn't require 3D acceleration, which it then has to emulate through CPU. XFCE (which is what I use), LXDE, or maybe Mate should do the trick.

    @NTAuthority said:

    Do you people not care about proper path handling, which both MSYS2 and Cygwin seem to lack, especially when translating command-line arguments from POSIX-style argc/argv arrays to BaseDLL command lines?

    I try not to think about it too much.

    #YOLO.



  • @cartman82 said:

    I found this problematic because of file permissions. Everything you yank through Windows ends up with 777 access rights, which is super annoying for me.

    I have it forced that all files over samba have 0644, you can do it with mount options.

    @cartman82 said:

    You just need to pick a desktop with lower graphics requirements. Something that doesn't require 3D acceleration, which it then has to emulate through CPU. XFCE (which is what I use), LXDE, or maybe Mate should do the trick.

    If you do touch typing, it will annoy the shit out of you when there's even a slight delay when you type. That's what you always get when you work with VMs, even in the raw tty.



  • For windows terminals, the one I keep coming back to is jessies.org Terminator. There's a lot to hate about it: basically defunct at this point (as in, still hosted on google code), requires both cygwin and java, horizontal scrolling. And not a lot to love, specifically (it gets select-to-clipboard and middle-click-to-paste as right as it is possible to get it in windows, but I'm pretty sure there are other terminals that do that), but for some reason, I always get frustrated with the other terminals and keep going back to that one.

    Pretty sure it does have the best look-and-feel out of any terminal that's available on windows, though.

    Edit: looking at the wiki, it also requires ruby, in addition to cygwin and java. But it does handle utf8 properly, which is more than I can say for some of the windows terminals out there.



  • @Buddy said:

    (it gets select-to-clipboard and middle-click-to-paste as right as it is possible to get it in windows,

    Both of those things are completely broken and wrong in Windows.

    Unless you mean it "gets them right" by not doing them at all.



  • Well, FUCK WINDOWS, then. JESUS CHRIST.
    Next are you gonna tell me off for having a clipboard manager (copyq) installed?


  • sockdevs

    I always find it amusing how, when certain people get a Windows, the first thing they do is try to make it work like a Linux.

    If you want a system that works like a Linux, don't get a Windows and try to make it work like a Linux, just get a Linux!



  • I've got a linux, and my employer is fine with people having a linux, as long as it works like a windows to them. Garbage like virus scanners, proprietary full disk encryption...


  • sockdevs

    @PleegWat said:

    virus scanners

    Eh, I'd be OK with a virus scanner on a Linux; if it's good, it'll prevent the propagation of viruses that would infect a Windows



  • It used to be clamav, which wasn't a problem because it doesn't do shit. Now it's mcafee, which is of the old '2 virus scanning CPUs required for each working CPU' division.



  • @Buddy said:

    Well, FUCK WINDOWS, then. JESUS CHRIST.

    Sorry?

    Look, if the software runs in Windows, it ought to behave like Windows software does.

    I'm sorry if I'm calling-out your broken software for being broken.



  • Look, it's a feature that I like. I don't give a shit whether it's ‘proper’ or not, I just like being able to do my job with a minimum of effort. When you're working in an environment where ctrl+c and ctrl+v have pre-existing meanings, select to copy and middle click to paste are the best alternative. Having a secondary clipboard for selected text — so as not to k.o. your clipboard every time you select something — would be nice too, but unfortunately windows lacks that feature. Terminator does the best it can, given the environment.



  • @Buddy said:

    When you're working in an environment where ctrl+c and ctrl+v have pre-existing meanings,

    Those meanings have been wrong since 1984. How many decades do you need before you catch up with the rest of us?



  • You've been wrong since 1984.



  • @cartman82 said:

    Git shell seems either a reskin or very close fork of Msys2, both of which are laying on top of combination of Cygwin and MinGW

    Cygwin is a compiler-level emulator for the Linux kernel APIs that runs on Windows.

    MinGW is a port of the GNU Compiler Collection to Windows.

    They're not the same thing. In most cases, Cygwin is unrelated to whatever you're doing.



  • @blakeyrat said:

    @cartman82 said:
    Basically, there's nothing git for windows gives you that you don't get with msys2 or base cygwin. Just branding, context menu and a few preconfigured options (not counting the native GUI tools).

    Yes there is. You run ONE installer, and then it's there and working perfectly.

    Basically, there's nothing Windows 10 gives you that you don't get with a soldering iron and some metal scraps.


  • :belt_onion:

    @Buddy said in Windows 10 shell environment:

    it gets ... and middle-click-to-paste as right as it is possible

    Meaning it does no such thing? I hate that crap, and one of my first drills on Linux is to disable that misfeature. Hate it when am writing some code and suddenly a link is pasted right there in the middle while scrolling. Other crappy Linux defaults is middle-click-on-titlebar for alt-tab :wtf:


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.