Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Babun – A new Windows shell (babun.github.io)
180 points by blearyeyed on May 13, 2014 | hide | past | favorite | 108 comments


Another ^nix -> Windows package system is the pacman port available in msys2: http://sourceforge.net/projects/msys2/

msys2 has an impressive package list [1] and is almost [2] an amazing solution for mixed-platform projects.

[1] https://github.com/Alexpux/MINGW-packages) [2] The one caveat is that it is still susceptible to the Cygwin BLODA problem whereby under certain conditions and software combinations, Windows becomes dangerously unstable after too many calls to fork.


And this is why I can't hate Microsoft. They've vastly improved over the past 20 years! Why, I remember when Windows became dangerously unstable when you did not properly release a GDI resource or passed the wrong things into RegisterClass...


What has Microsoft to do with MSYS2?


I think he was referring to this bit: > Windows becomes dangerously unstable after too many calls to fork.


While part of me still wants to tell would-be hackers to just switch to OS X or Linux, I've realized recently that a lot of hackers are bound to Windows because they use various software that only works on Windows, like games, or because of social limitations.

I have no clue how good Babun is, but I have no clue how I ever got anything done on Windows without a Unix shell. Cygwin is not out-of-the-box enough, and the package manager is buggy. If Babun really works, I think it will matter a lot.


I'm on Mac so don't bite my head off.

That said, I was much more productive on Windows for many things. You mentioned games. Game development is much larger on Windows. More access to more engines, tech, examples, tools, etc.

Visual Studio's debugger still blows away anything I've seen on Mac or Linux. PIX, Microsoft's GPU debugger is still the standard to be met.

.NET, C# and Windows Forms were amazing ways to bang out tools for artists and designers that I've seen no match for on other platforms yet.

I guess the short of that is, it really depends on what you're working on.

But I'm still amazed that those things are missing on other platforms. It's not like Visual Studio is some new product. It's been arguably the best debugger for 15+ years? It's surprising that no one as duplicated it on other platforms.

Same with Windows Forms. Sure there are UI libraries but none of them have that perfect storm of features that makes banging out certain kinds of apps so easy. I'm guessing the most used features are Windows Forms Property editor (point it at a class, get instant interface to edit all of the class's properties). Another is probably their data grid editor.

So yea, I love me some unix shell but I'd prefer not to have to choose a good shell vs good other things.


That is a good point. Visual Studio is actually one of the things I have positive emotions about from my Windows days.


I'm a self-taught programmer. I've basically been using linux 99% of the time for the past five years, and just have a partition that runs windows if I need it. Funnily enough, the first real programming gig I landed is a full time job doing full stack .NET development, so now it's sort of flipped around. I do miss the command line. I'll have to check this out. I've been looking for a good windows shell replacement.


You should take a serious look at using powershell, they've aliased a lot of commands to what you expect on linux so you're not completely foreign and it's got a similar workflow mentality you're used to i.e pipe commands.

And you can work with .NET natively.

That said it is NOT to imitate linux, it's conceptually not the same which is good because Windows isn't either.

Here's a 101; commands are `verb-noun -parameter value` these pipe | objects(!) not strings. The first thing you should do is win+R powershell type: get-alias and after that `get-help ls` just drop in powershell wherever you used to calling cmd and see how it goes.


Another word of advice: Try to use the pipeline as much as possible. Passing objects through the pipeline is a core concept of PowerShell for a reason. Don't try writing C# with PowerShell syntax (as I see so many people do on Stack Overflow).

Some answers I have written on SO that exemplify that:

http://stackoverflow.com/a/7394766/73070

http://stackoverflow.com/a/1046291/73070

http://stackoverflow.com/a/14481495/73070


I just glanced at the top post you have linked here (I'll definitely take a look at the others later). At first glance it reminds me of unix pipes, clojure's thrush operator, and F#'s pipe forward operator. (they're all different from one another, of course, but the general idea of threading data through pipes/filter/transformations to get what you want)

If I'm not totally missing the mark there, and that's the idiomatic way to do things, I'm glad. I really prefer dealing with scripting/command line stuff that way.

Really appreciate the information!


Powershell is a great language. I would love to see unix shells inspired by it.

The associated toolset, on the other hand, is clearly not there yet. As soon as you start doing real things with PowerShell, you will hit all sorts of bugs and limitations.

Your mileage may vary, of course.


Remoting and signing has been a nightmare to set up on my domain but otherwise so far I'm still having a pleasant experience. Obviously the console itself is the same as cmd's which is terrible. I just work a lot with the ISE open but still looking for a slicker terminal.

I've been able to just deploy PS v4.0 across all of my computers I think a lot of the headache comes from trying to use new stuff and seeing windows 7 ship with v2.0

I'm curious what kind of things you're running into, I'm getting quite immersed in using PS all over.


Well, what you said, crappy console, no ssh (the powershell equivalent is just not very good), but also, no grep (findstr is not a good substitute), no rsync, etc.

Whatever I've attempted I've always hit unexpected walls due to the unavailability of tools we take for granted with linux.


I'll parrot one of the PS developers;

"grep, sed and awk etc are really great on nix because they're great with text, they're text based operating systems and you can do anything with them. Windows is an API based system so just moving text around doesn't get you very far."

There's a mountain of filters available in the cmdlets parameters but specifically since you mentioned grep. findstr is not powershell it's in the old cmd family of programs still in your PATH. You want to look at select-string http://technet.microsoft.com/en-us/library/hh849903.aspx

I wish MS would include SSH but the party line is they've no idea who really wrote the code and they won't include it in windows in case they get sued over it.


The other thing worth looking at is the MinGW project. It's pretty easy to get started with the mingw-get package manager (there's an installer you can find here: http://www.mingw.org/wiki/Getting_Started).

Once you have mintty running as your terminal emulator, and a decent shell like bash, life gets a whole lot easier.

The upside is that it's fully native without Cygwin's compatibility layer. The downside is that it won't have as many ported utilities (and probably not as easy to get started with as something like Babun).


http://code.google.com/p/mintty/ seems like it still uses cygwin1.dll (or whatever it's called these days). Am I missing something?


Yes, you are missing the MSYS build listed on their download page. It does not use Cygwin.

MSYS/Mingw are native ports of the GNU software tools and friends.


Well, I'm on Windows because I don't bother. It's just my workplace machine, running browsers, terminals (so thanks Babun, will try it out now) and a bit of other stuff I don't need Linux for. Yes, my private notebook runs Linux. All my servers do. But our IT departement is Windows centric, and that's about that. While I'm free to configure my desktop machine just the way I want, I prefer to not spend time doing this. I just use the Windows system they gave me, and when it breaks, I call in and they will give me an off-the-shelf new one. Not in a mood to spend my time with fiddling with my desktop machine. The most complex piece of software it runs is the browser.


I haven't been gaming lately nearly as much as I've used to, but it's still a big part of my computing needs and I just can't get good enough performance in Linux even though PlayOnLinux really has made installing games easier.

I'd love nothing more than run Linux as my main OS, but I hate having to reboot whenever I feel like playing a game.


Lost me at "based on Cygwin".

Yes Cygwin brings some unix goodness, but it has enough warts that I avoid it.


I wish I knew why so many Windows devs hate Cygwin. It has some pretty poor default settings, but you can change your .bashrc just like on Linux, or ditch the whole thing and use zsh instead, which works out of the box with oh-my-zsh (it looks like Babun does this as well.) For me, Cygwin is a very comfortable environment for git, programming and basic file management.

It's also the only way to get Linux shells to run on Windows, since they all rely on fork(). Even MSYS is just a fork of Cygwin 1.5.


I don't hate Cygwin, but anything using it should bill itself as "blah on top of Windows", not "blah for Windows".

(Or alongside if you want to say it that way.)


Yep. Give me something built on msys anyday.


Can you give some examples?


http://cygwin.com/faq/faq.html#faq.using.bloda

(not really Cygwin's "fault" per se, but it is what it is)


I almost got a 0 on a programming project for an intro to CS class because it compiled and ran perfectly fine on Windows, but segfaulted on Linux.


Which is much less a Cygwin problem than a poor understanding of the tools problem.


How is it not a cygwin (well, technically gcc for cygwin) problem? The port of gcc was bad, that's all there is to it. When I found a bug where a certain version of clang on ARM wouldn't compile a program everything else was compiling, was it a problem with my understanding or was it a bug with clang?

cygwin's ports aren't going to be 100% perfect, not sure why you would claim that if there's a problem with it, it's MY misunderstanding that's the problem.


I was actually expecting a new GUI shell for the recent windows versions. I used to run bb4win in the w2k times, but it doesn't look like win 7/8 have any popular alternative shells available. Does anyone know of those?


There is nothing wrong with current shell. Who needs window resize or copy&paste anyway?


Now, now, be fair.

alt-space > e > p becomes pure muscle memory.

It's actually a really elegant key combination that I definitely did not have to look up 10 times before it stuck because no other program uses it.

And of course powershell, which doesn't Get-Have-The-Most-Over-Verbose-And-Stupid-Naming-Conventions-Ever and have a terrible language design that results in [console]::writeline("Powershell {0} being a complete farce", "not") solves a lot of these problems.


Just to be fair:

1. Clink [−7½] and PSReadLine [𝜋] both enable you to press Ctrl+V. On Unix-likes you're told to use a better terminal emulator to handle such cases nicely (something like ytcxbcixvt or what's hot these days) and most people don't think twice about heeding that advice, yet on Windows people willingly suffer, grumbling and complaining?

2. gal and Tab help a lot. And I actually prefer commands like Import-Csv over things like almf in readability (at least they weren't formed by bashing your head on the keyboard). But that might just be me.

3. 'PowerShell {0} being a complete farce' -f 'not'. In the scripts I've written I could probably count the number of [Console]::WriteLine calls on one hand (unary).

[−7½] http://mridgers.github.io/clink/

[𝜋] https://github.com/lzybkr/PSReadLine


Surely just turn on "QuickEdit mode" and paste by clicking the mouse.


You can resize a cmd shell in the properties, and as someone posted in a sister thread, turn on Quickedit to smooth out copy and paste.

Turning on tab completion requires some fiddling though (and I have no idea if it survives in newer version of Windows).


Seriously, have you tried these "solutions"? It's like rubbing salt into the wound.


Sure. But I don't have a lot of Unix/Linux background, so I don't really know what I'm missing.

(I anyway wouldn't try to defend them as solutions, just clarifications of what is possible)


I've been using ConEmu [0] for over a year now, and it's miles better than the default console. I actually spend a majority of my time in Windows in the console now.

[0] http://sourceforge.net/projects/conemu/


Blackbox is working on windows 8. If you head over to deviant art you can find some shots of working setups on the Blackbox group: http://blackboxdesktop.deviantart.com/


That's a very fragmented community, there seems to be zipfiles of random builds of dubious origin flying everywhere. Where's the "upstream" source?


LiteStep seems to be active with development much easier to follow than BlackBox - https://github.com/lsdev/LiteStep


I ran a whole lab of Litestep customized for a library once. I loved it. Later on, when I got into Linux, I fell in love again with the more exotic WM's largely because of my experience with Litestep.

I have to admin Winboxen all day, so I should try it out with Windows 7. I have not used it in ages. What is said is, last time I had this inclination, they lost part of their CVS/SVN history (after a recent upgrade) in part due to lapsing hosting or something.

I think I begged for a copy of the repo for nostalgia and got it from a newer dev.

Long live Litestep! Try to have a student hack into a Windows kiosk running Litestep, and boy oh boy will they (and so did I) find it difficult to get into system tools on the spot!


Is there a centralized site for blackbox? I had trouble finding resources when installing on windows 7.


I was also expecting a new GUI shell and used to run GeoShell and Litestep. I got somewhat excited and hoped that there might be a resurgence in the popularity of Windows shells but it seems like that time is gone for good now.

If I recall correctly, the Windows XP release managed to stabilize the Explorer shell quite a bit (compared to Win9x) which in turn decreased the demand for a lightweight, stable and customizable replacements.


I believe lightstep is also working on windows 8 now.


KDE, but it's still fledgling on Windows: http://windows.kde.org/


Power shell?


They meant a replacement for Explorer as the GUI shell. Don't confuse the following things:

1. Command-line shell (cmd, PowerShell, bash, whatnot)

2. GUI shell / desktop environment (Explorer, Gnome, KDE)

3. Console host / terminal emulator (conhost, console2, conemu, xterm, ...)

Invariable all of those are referred to as »shell«, sometimes even by people who ought to know better. The linked site makes the same mistake. It's not a new shell for Windows, it's just zsh bundled with cygwin.


I've been using Cmder(http://bliker.github.io/cmder/) for quite some time when I'm on Windows, normally I just develop on Vagrant or Nitrous using Nitrous Desktop, so when I develop I'm always using an UNIX terminal, Cmder allowed me to do so on Windows, it depends on Console2 and it's quite nice, but oh-my-zsh is actually way more awesome, if this works nicely I'll consider switching. Babun seems to be much more serious than Cmder though, the fact that you can update it using 'babun update' and you can create plugins and such makes it so much potent.


Just a note: Cmder uses ConEmu, not Console2 :)


I immediately recognized the `pact` tool to be a clone of `apt-cyg`. Did a search on the repo source to confirm (https://github.com/babun/babun/blob/45484c55a3b017248329ddd5...). It seems as if the author of Babun is trying to pass off apt-cyg as his own creation.


Going down the list of Babun features, it doesn't look like much more than repackaged cygwin. I thought pact was the biggest innovation, but as a clone of an existing project it seems misleading to call this "a new Windows shell."

It isn't without value, as others have said cygwin could be made more usable out-of-the-box, but a little more credit should be given where credit is due.


I also noticed this. I immediately thought ot myself, "How is this any different than my current set up with Cygwin and apt-cyg?"

Surprise: It's not!


A more mainstream alternative is cmder: https://bliker.github.io/cmder/


That looks like mostly a skin for conemu, no? I've desperately wanted to like conemu, but every time I use it something ends up broken in weird ways (hung tabs, garbled output).


I agree. I really want to like it, but moving through history with the arrow keys can often crash that tab.


Have you reported your problems? Thought no...


I tend to install absolutely the whole cygwin (32-bit and 64-bit in two different folders). Always use the stable, and install the debug, since it's easier this way. It's quite big (~20 gb each install - but that includes all debug symbols).

I'm using all the time Far Commander calling cygwin commands. Some of the commands are not "callable" since I'm not running Far Commander through bash.exe/sh.exe (it's possible but a bit unstable). For such cases when the cygwin command does not have .exe/.com/.bat extension I run it "sh -c cmd blah", or create shortcuts for most used commands:

  gitk.cmd (somewhere in my PATH)

  @start /B ash -c "DISPLAY=:0 exec /usr/bin/wish /usr/bin/%~n0 %*"
I also have this in the Startup folder:

  startxwin - 1>nul 2>nul
Tig is also awesome for git browsing.


No PowerShell integration makes this useless to me unfortunately.


Everyone who would be satisfied by Cygwin is already using cygwin. so this will not help them.

and people using CMD must use CMD for some reason, and even though that crowd would be please by just being able to maximize their windows, this does not offer any improvement for those people.

sadly, i'm in the second group.


Have you looked at Console2?


thanks!


This looks great, but still has one no-go bug: Spaces in directory names don't work.

https://github.com/babun/babun/issues/74

and it looks like they don't really want to fix it: >We need an install.bat fix to stop the installation in such cases.

The problem is, especially on older Windows machines there are always spaces in directories - XP and 2000 have 'Documents and Settings' in their %USERPROFILE%, so installation will always fail on these (?!?), others will have problems with having a space in their user-name.

This seems to stem from Cygwin.


VirtualBox with a shared directory is also a way to have all the niceties of unix without installing MinGW or Cygwin.


Unless your asshole infra team configure the SOE to actively bork vbox installs because everything is a "security risk". (But are still running EOL WinXP).


Unless you actually have to work on that shared directory, at which point the abysmal performance results it in being nigh-useless.


You can't invoke binaries on the host that way, though.


I don't mean to sound like a prick, I'm just genuinely curious as to why someone would use windows for some CLI work. Are you using some software that isn't available on more developer-friendly operating systems?


1. Because they prefer Windows.

2. Because their company has standardized on Windows desktops and/or hardware.

3. Because some people might actually believe and have good evidence that Windows is a more "developer friendly" operating system for their needs.


1 and 2 are perfectly legit reasons to use Windows. 3, though seems weird. If you're installing something like Babun to make your windows machine act more like a nix machine, it seems reasonable to assume that a nix box would be better for your development needs, and that you have some other reason for using windows (like #1 or #2).


Well, if you're developing for Windows, or developing for the web and need to test Internet Explorer, or if you're either doing UI design or dealing with other people's UI designs and need access to Photoshop or Illustrator, or if you're using Visual Studio at least some of the time, or if you're working with a MySQL database and want to use something like SQLyog... there's lots of tools on Windows that can be useful for developers, and someone can very reasonably conclude that Windows (through something like this) offers better access to nix tools than nix offers to Windows tools via Wine.


There are those of us who actually enjoy Windows and prefer using Vagrant with zsh when doing Linux devevlopment.

OS X just doesn't cut it when it comes to keyboard shortcuts and window management... Linux is nice but lacking in stuff not related to development.


Keep in mind that it's making the box act MORE like something else, but NOT less than what it currently is. People using cygwin and stuff like babun don't take away from windows, they add to what windows already provides, gaining a more diverse toolbox. On the flipside, adding things windows provides to *nix boxes to gain the same diversity in the toolbox would be very very hard.


My situation is I have a Windows machine I game on and don't like rebooting all the time to get into my arch partition. It'd be nice to have a good shell to do some dev work on if I wanted to fix something really quick without rebooting. Right now I just boot up a vm and work on that. Shells I've used in the past (ConEmu, Console 2, Cmder) have all been good, but not good enough.


You should try starting your arch partition in virtualbox, I've had success doing that before (you can still boot into it normally as well).


I use Console 2 with Cygwin in conjunction with an Ubuntu VM on my Windows 8 desktop and it works beautifully - best of all worlds.


I know from personal experience that Steam works slightly better on windows than linux, so I see your point there.


Never mind the plethora of games which are Windows only.


Yes, compatibility with existing software is a big part of it. Unless you're exclusively developing for _nix environments you'll have to use Windows at some point.

Also, I think Windows has (or had, depending on preference) a great GUI and a dismal CLI, while _nix is mostly the other way around.


OS X has both actually.


Apple makes it hard to run OS X on anything but Apple hardware. For anyone that doesn't want to be bound to Apple hardware, this is not really even a real option.


It's trickier to get OS X working on a laptop, but building a Hackintosh desktop is quite easy. A lot of motherboards are entirely compatible, while everything else (CPU, RAM, storage) works anyways.


Aside from the fact this is not strictly legal, my experience has been that this is more effort than it's worth. And if you have any hardware that's a bit non-standard, you can forget about it.


Like I said, building a Hackintosh desktop is as easy as building a Windows one. If you want to install OS X on a random PC that's laying around the house, the outcome will of course be different.


Why wouldn't you want to be bound to Apple hardware? I've yet to come across a laptop form-factor that even approaches the Macbook Air. The hardware is a strong selling point for Apple devices. Sure, you might be able to put together a more powerful machine for a lower price, if your time isn't worth much to you or you enjoy building computers, but have fun machining an aluminum casing for it and getting it under 3 lbs.


The Macbook Air has had a pretty embarrassing screen resolution for some time now. There's also a dearth of peripheral connectivity for more advanced setups. That's even assuming I want an ultrabook and not something else entirely.

It seems a little arrogant to assume your specific hardware requirements are everyone's hardware requirements.


You're right, in retrospect that comment was incredibly shortsighted.


If you have a tight budget? If you want to play games or generally have desktop class hardware without buying a Mac Pro? If you want a higher resolution display than the MacBook Retina ones? Touchscreen?

I prefer Apple hardware, but I'm not exactly a fan of being bound to it.


For laptops I think Apple makes fine products, but I don't really feel like dropping the money for new desktop just to get OS X


Absolutely agreed. Form factor isn't nearly as important with desktops, especially when you can put any OS you want on it. I'd happily run a Hackintosh on desktop, if I were a fan of desktops at all.


Megacorps. FIRE. Standard Operating Environments.

While I am actively infecting my org with FOSS, those of us working in corp land are often forced to use a Windows box behind an NTLM proxy and are blocked from installing vbox.


I love you. I was thinking how awesome it would be to use tmux on my windows machine so I tried pact install tmux and it worked.

Thank you so much, that's pretty awesome.


Great Work. Brings windows more closer to linux


>Would you like to use a linux-like console on a Windows host without a lot of fuzz?

s/fuzz/fuss ?


The first thing to install with cygwin is rxvt, which runs native (not in X)


I thought rxvt doesn't support Unicode?


Also Console2.


Can this completely replace git-bash? Does it have ssh and ssh-keygen?


I find it kind of funny how the first thing I wanted to see about this shell was screenshots. That said, it does feature syntax highlighting so that's not entirely ridiculous.


From the video:

> There's also a rich syntax highlighting

> invokes vim

Durrrrr


Stopped reading after cygwin was mentioned.


I wish something as nicely preconfigured as this was available on Linux


"on top of Cygwin"... So does it mean still no copy&paste?



Copy and paste work here.


Yes! Select the ctrl+shift+letter option in Keys, and you'll even have ctrl+shift+c and ctrl+shift+v working. That, and the console window auto adjusts to resized window makes for a great start for me. Not to mention the ctrl+scrollwheel or plus/minus for changing the font size. Kudos to the devs.


install rxvt


So apart from the package manager, Babun is basically for people too lazy to install Cygwin, copy over their dotfiles and set a custom font?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: