News for hackers. Stuff that matters.
Re:Gow – The lightweight alternative to Cygwin by quotemstr on Saturday November 08, 2014 @12:42PM (#8577554)
Cygwin is a fantastic system put together by people crazy and talented enough to dig deeply into both the POSIX world and the NT world. I can't recommend it highly enough. A bag of ported utilities is absolutely no substitute for something that, in effect, amounts to GNU/NT.

Yes, there are some warts, but they're papered over remarkably well. Give mintty a shot: you'll never go back to conhost.

Re:Gow – The lightweight alternative to Cygwin by diltonm on Saturday November 08, 2014 @12:52PM (#8577580)
I completely agree, Cygwin has real OpenSSH, well you can even run Gnome on Windows if you want; even as your main shell or I was doing that back in 2002 not sure it would work these days. Overall Cygwin can't be beat. If Gow has enough utility for folks who want to use it; that's cool but for me when I'm stuck using Windows for anything, Cygwin rocks.
Re:Gow – The lightweight alternative to Cygwin by a3n on Saturday November 08, 2014 @03:35PM (#8578079)
I run cygwin X so that I can have the tabbed version of urxvt.
Re:Gow – The lightweight alternative to Cygwin by fuzzix on Sunday November 09, 2014 @06:39AM (#8579679)
I ditched mrxvt long ago because of lack of Unicode support (though I did use it under Cygwin/X).

https://github.com/simonzack/urxvt-tabbed - is this the project you're using?

Re:Gow – The lightweight alternative to Cygwin by a3n on Sunday November 09, 2014 @07:25AM (#8579746)
No, not an external project, just one of the "official" rxvt variants. I use the same one on linux as on cygwin/X.

rxvt-unicode-256color

I use it on cygwin at work because I use it on linux at home, because of the tabs (which are text-based and have nothing to do with whatever desktop environment it's running in), and because the 256 colors make it easier for me to distinguish different code parts in a colored text editing session.

The default terminal in cygwin is OK, but the small number of colors were really bothering me (old eyes).

As for unicode, I've displayed Japanese and other scripts in rxvt-unicode-256color just fine.

Re:Gow – The lightweight alternative to Cygwin by a3n on Sunday November 09, 2014 @07:50AM (#8579780)
Here we go: http://imgur.com/eRea4I2

The right terminal has two tabs open, and it shows unicode displayed in the last command.

This is on linux, it looks the same on cygwin (except it has window borders there).

Re:Gow – The lightweight alternative to Cygwin by barrkel on Sunday November 09, 2014 @10:10PM (#8581861)
FYI, the default terminal for Cygwin these days is mintty, which supports 256 colours.
Re:Gow – The lightweight alternative to Cygwin by fuzzix on Sunday November 09, 2014 @09:48AM (#8579981)
Oh super, thanks. I'll have to try that out.
Re:Gow – The lightweight alternative to Cygwin by ZenoArrow on Sunday November 09, 2014 @11:03AM (#8580108)
Wouldn't it be better just to use ConEmu and mintty? I looked at urxvt but the ConEmu+mintty combo had all the features I wanted and was more up-to-date than urxvt.
Re:Gow – The lightweight alternative to Cygwin by a3n on Sunday November 09, 2014 @12:00PM (#8580248)
mintty doesn't have enough colors for my eyes.

I use conemu for my windows command shell. I have tried it to run a cygwin bash shell, but I recall there being some annoyances, don't remember what anymore.

But fundamentally, no, it wouldn't be better to run ConEmu and mintty, because urxvt is exactly what I like. :)

Re:Gow – The lightweight alternative to Cygwin by ZenoArrow on Sunday November 09, 2014 @11:26PM (#8582010)
Fair enough if urxvt is exactly what you like. Not sure what you meant by the colour comment though, both urxvt and mintty support 256 colours... http://superuser.com/questions/736873/enable-256-colors-for-...
Re:Gow – The lightweight alternative to Cygwin by a3n on Monday November 10, 2014 @06:54PM (#8587437)
I tried the above for colors in mintty, nice, thanks.

As for running mintty in conemu, it's still not quite right. If I figure it out, this will be what I recommend to people.

But for me, I like having urxvt the same at home on linux and at work in cygwin. I use urxvt's keyboard management of its tabs a lot.

Re:Gow – The lightweight alternative to Cygwin by Moto7451 on Sunday November 09, 2014 @12:18AM (#8579192)
I disagree. Having gnu utils available from CMD is a God send. Sometimes a batch script is the right tool but you need the capabilities of something from gnu utils. It's much simpler to just invoke the tool than to rewrite the script as a windows flavored bash script you run from Cygwin.

Additionally you'll find a lot of scripting language libraries just wrap gnu utils and invoke commands using a sub shell. Being able to run those scripts/libraries from batch files or other windows processes without dealing with Cygwin is awesome too.

Re:Gow – The lightweight alternative to Cygwin by deng on Sunday November 09, 2014 @04:44AM (#8579511)
Indeed. Cygwin is fantastic, but one must always remember: once you go there, you can never go back. If you mix native Windows binaries with ones from Cygwin, all kinds of weird things can happen. I mostly work with native Windows binaries from ezwinports nowadays, together with ConEmu, Eclipse and a native Emacs; I can use normal Windows paths and things Just Work. Granted, it's more cumbersome to set this up than just installing Cygwin, but people are working on that (see for instance: MSYS2 at http://msys2.github.io/)
Re:Gow – The lightweight alternative to Cygwin by quotemstr on Sunday November 09, 2014 @06:20AM (#8579648)
> once you go there, you can never go back. If you mix native Windows binaries with ones from Cygwin, all kinds of weird things can happen.

I used that setup all the time and it worked fine for me. Mixing win32 and Cygwin binaries is the point of Cygwin, as far as I'm concerned.

Re:Gow – The lightweight alternative to Cygwin by deng on Sunday November 09, 2014 @07:24AM (#8579743)
Then you are a lucky man. Ever tried to work with MsysGit in a Cygwin shell? For starters, there's the CR-LF vs LF problem, which can screw you big time. Then there's the problem that Cygwin handles Windows paths differently from MSYS (C:\foo becomes /cygdrive/c/foo on Cygwin, /c/foo on MSYS, but that's just the obvious difference, filename handling is actually much more subtle). And then there's the stuff which you won't notice until it bites you, like for instance '.cmd' and '.bat' not being treated as executables in Cygwin.
Re:Gow – The lightweight alternative to Cygwin by quotemstr on Sunday November 09, 2014 @12:14PM (#8580270)
> Then there's the problem that Cygwin handles Windows paths differently from MSYS

I don't use MSYS, but my Cygwin installs are rooted at C:\. Win32 path functions actually accept forward slashes as well as backward slashes as path separators, so often, Win32 programs interpret paths like "/etc/passwd" just fine (with the drive resolving to C:\).

LF-versus-CRLF is an annoyance, but I've always solved it by using wrapper scripts that invoke u2d and d2u to perform the proper translation.

I think I previously my "injob" utility. Thanks to your comment, I got around to putting it on github: https://github.com/dcolascione/injob

Re:Gow – The lightweight alternative to Cygwin by gregschlom on Saturday November 08, 2014 @02:03PM (#8577817)
> Give mintty a shot: you'll never go back to conhost.

No, give cmder a shot: http://bliker.github.io/cmder/ I've tried mintty and cmder, and cmder was just perfect for me.

Re:Gow – The lightweight alternative to Cygwin by Jare on Saturday November 08, 2014 @05:32PM (#8578342)
I use Mintty because Cygwin's tmux didn't work with ConEmu or Cmder, but Mintty was ok.

FWIW, I took a quick stab at the tmux & ncurses code to try to find a fix, but it was far from obvious. Maximus (ConEmu author) said it had to do with how cygwin flags stdin streams, which just happens to break when ConEmu provides them. (sorry details vague)

Re:Gow – The lightweight alternative to Cygwin by quotemstr on Sunday November 09, 2014 @06:16AM (#8579642)
Quickly scanning the code, it looks like ConEmu is using hooking to implement the Win32 console API and forward calls to the terminal emulator. That's a good approach, but it needs to be integrated into the Cygwin pty system to really work well in that environment.
Re:Gow – The lightweight alternative to Cygwin by pmoriarty on Saturday November 08, 2014 @03:11PM (#8578009)
How does cmder compare to ConEmu?

https://code.google.com/p/conemu-maximus5/

Re:Gow – The lightweight alternative to Cygwin by abrichr on Saturday November 08, 2014 @03:33PM (#8578073)
It appears to be built on ConEmu. From the homepage:

> Think about cmder more as a software package than a separate app. All the magic is happening through Conemu. With enhancements from Clink.

Re:Gow – The lightweight alternative to Cygwin by ElliotH on Saturday November 08, 2014 @03:51PM (#8578110)
Oh my goodness thank-you! I'm forced to use Windows at work, and this is the first terminal emulator that looks not terrible!
Re:Gow – The lightweight alternative to Cygwin by kyzyl on Saturday November 08, 2014 @04:11PM (#8578163)
Might take a look at Babun[1] as well. It's a fairly pretty emulator with a built-in cygwin tree, and integrated (default) zsh.

[1] https://github.com/babun/babun

Re:Gow – The lightweight alternative to Cygwin by whoopdedo on Saturday November 08, 2014 @05:32PM (#8578344)
The problem I have with console replacements is most of them break readline. You can't run many interactive programs with them. On the other hand, you can't have full unicode support without a console replacement.
Re:Gow – The lightweight alternative to Cygwin by quotemstr on Sunday November 09, 2014 @06:26AM (#8579655)
Indeed. People need to stop thinking in terms of building win32 "terminal emulators" (most of which involve god-awful hacks, like scraping hidden conhost windows) and instead emulate the Win32 console API in userspace (just like Windows itself did before Windows 7) and implement the Cygwin pty interface in terms of this library. This way, Cygwin programs think they have a pty and Win32 programs think they have a console, and everything Just Works.

But people would rather just hack up a "terminal emulator" instead of doing things the properly and the hard way.

Re:Gow – The lightweight alternative to Cygwin by bkeroack on Saturday November 08, 2014 @02:53PM (#8577955)
The issue with Cygwin is that disk IO in particular is incredibly slow. Which makes things like git substantially slower than on Linux or OSX.
Re:Gow – The lightweight alternative to Cygwin by rossy on Saturday November 08, 2014 @11:13PM (#8579073)
The problem isn't with disk IO as much as it's with speed of the stat() syscall. IIRC Cygwin stat() is backed by three different NT syscalls, so it's slow because it requires three transitions to kernel mode, where Linux only needs one. Setting core.fileMode to false makes Git use a Windows optimized version of stat(), so it runs a lot faster.

Unfortunately it's still not quite as fast as on Linux and OS X, but it's about as fast as native/MSYS versions of Git on Windows.

Re:Gow – The lightweight alternative to Cygwin by quotemstr on Sunday November 09, 2014 @06:19AM (#8579646)
> three transitions to kernel mode,

It's not the number of "transitions to kernel mode" (which is actually really fast), but the cost of performing the UID mapping, especially considering that this effort is frequently wasted when programs don't bother inspecting st_uid and friends. That's why I wish the Linux xstat syscall, the one that let programs ask for just what they need, had gone through: it'd have made other systems more efficient too.

Re:Gow – The lightweight alternative to Cygwin by ape4 on Sunday November 09, 2014 @11:08AM (#8580119)
Can't the UID mapping be cached.
Re:Gow – The lightweight alternative to Cygwin by deng on Sunday November 09, 2014 @04:03AM (#8579451)
MsysGit is still way slower than Git on Linux, at least on larger repositories. Calling stat() on lots of small files is pretty much a worst-case scenario for NTFS.
Re:Gow – The lightweight alternative to Cygwin by yuhong on Saturday November 08, 2014 @03:51PM (#8578109)
On Cygwin, I wonder if a SetCurrentDirectoryEx function would be a good idea: https://cygwin.com/ml/cygwin/2012-04/msg00632.html
Re:Gow – The lightweight alternative to Cygwin by agumonkey on Saturday November 08, 2014 @02:31PM (#8577905)
A very convenient improvement that makes a difference is http://mridgers.github.io/clink/ (readline mostly). Tiny, useful, fresh air.
Re:Gow – The lightweight alternative to Cygwin by girvo on Sunday November 09, 2014 @05:06AM (#8579546)
Oh, wow. I don't run windows anymore, but that's quite an amazing little tool. My work mates who use windows are going to be stoked with this, thanks. Currently they're all use cmder, but some struggle with the impedance mismatch of a GNU/NT system like that. This with native binaries will be an amazing setup!
Re:Gow – The lightweight alternative to Cygwin by agumonkey on Sunday November 09, 2014 @06:27AM (#8579658)
Yeah, clink author hit the nail on the head. `Minimally Enjoyable Upgrade` I guess.