News for hackers. Stuff that matters.
Re:Fish shell 2.0 by acron0 on Friday May 17, 2013 @07:25AM (#5723670)
Why is no one putting in any time to replace the Windows shell (cmd.exe)? The stock offering is abysmal and Cygwin isn't much better. We could really use something with a bit of panache like this... Hmmm..
Re:Fish shell 2.0 by spindritf on Friday May 17, 2013 @07:47AM (#5723712)
I'm guessing that people who cared about the terminal, and CLI in general, moved to other OSes a long time ago. And it's not just a glib answer, that's actually why I first gave Linux a real shot as my main system -- to replace Putty with a pretty, transparent terminal window and have all the GNU tools that go with it.
Re:Fish shell 2.0 by inoop on Friday May 17, 2013 @08:01AM (#5723756)
I can recommend console2+powershell. Powershell is basically bash but with object pipes instead of character pipes. It's all built on top of dotnet, so if you're familiar with c# you should feel at home with the API.

You can do stuff like

    ps | ? { $_.Name -match "iexplore" } | % { $_.Kill() }
to kill all instances of internet explorer. The `ps` command outputs System.IO.Process objects. The ? { ... } syntax is a filter, inside which you can use $_ to refer to the element you're matching. You can access the 'Name' property directly and use -match to match it against an expression. Finally the % { ... } syntax executes some code on every element, in this case it calls System.IO.Process.Kill() to kill the process.

Console2 puts a nice face on things and supports tabbing and resizing, as you would expect from a usable terminal window.

Re:Fish shell 2.0 by klibertp on Friday May 17, 2013 @10:14AM (#5724446)
Yes, but no.

I was working with this configuration for some time and it is really nice if you're satisfied with life inside MS's walled garden. The problem is that there is absolutely no interoperability with standard *nix tools. What's worse, PowerShell pretends that there is - `ps` in your example is just an alias for 'Get-Process' cmdlet, the same is true for cat, ls and other things.

Aside from that PowerShell is really solid shell. You can extend it with C# code and you get access to many .NET feature both in the command prompt and from PowerShell scripts. The scripts are quite nice for a shell scripts, it offers a few built-in data structures like arrays and hashes, there is a quite good autocompletion, even for .NET classes and objects and so on.

Re:Fish shell 2.0 by crosvenir on Friday May 17, 2013 @10:01AM (#5724360)
I love Console2. Be advised that it doesn't play nice with some things (or maybe the other way around?). I downloaded less for windows [1] yesterday and it completely hosed the terminal (changed all the colors and made the window ~10px wide and taller than my resolution).

Thinking back on it I'm not terribly surprised this happened given what Console2 is.

[1] http://gnuwin32.sourceforge.net/packages/less.htm

Re:Fish shell 2.0 by mkl on Friday May 17, 2013 @11:16AM (#5724812)
You may also like ConEmu (http://code.google.com/p/conemu-maximus5/). I switched to it from Console2 a few months ago and like it better - it has more customisation options and features like being able to move the cursor by clicking, administrator terminal in a tab, and the double-click to select a word thing that I constantly missed with Console2.
Re:Fish shell 2.0 by bliker on Friday May 17, 2013 @08:59AM (#5724007)
For me, powershell has very slow startup time. So I stick with cmd.exe. But it beefed up quite a bit. I am using:

- msys-git (I have ls, rm -rf... all unix goodness)

- clink (better tab completion, history, all around good stuff)

- console2 (styling)

- ansicolor (colored prompt)

and also I got some usefull aliases. If you are interested I can write down some steps for other people to follow.

screenshot http://i.imgur.com/hATwCVI.png

Re:Fish shell 2.0 by shocks on Friday May 17, 2013 @09:25AM (#5724137)
Wow that's a nice setup. I'm already using clink (my brother is the author), but I'm checking the rest out now. Thanks!
Re:Fish shell 2.0 by randomguy7788 on Friday May 17, 2013 @09:44AM (#5724252)
yes please! would love to have a setup like yours on windows
Re:Fish shell 2.0 by acron0 on Friday May 17, 2013 @09:17AM (#5724095)
That's beautiful!
Re:Fish shell 2.0 by mjs on Friday May 17, 2013 @07:36AM (#5723690)
Well, there's the Windows PowerShell:

http://en.wikipedia.org/wiki/Windows_PowerShell

It's actually got some quite interesting concepts, and is extremely consistent. These tips also convey the approach and how it works:

http://technet.microsoft.com/en-us/library/ee692948.aspx

Re:Fish shell 2.0 by WickyNilliams on Friday May 17, 2013 @10:04AM (#5724379)
I'm in the process of learning powershell, and I must say it's extremely intuitive. More so than BASH or CMD, I'd say.

Every command is of the form Verb-Noun. Which means you can get off the ground really quickly, as there are only about 15 different verbs. This means you can often guess what you want, even for commands you've never used. Still can't find what you want? Then you can use wildcard searching on the Get-Command command, which returns all matching commands!

The icing on the cake for me is the consistency between interacting with different data sets. For example, New-Item is a command for creating a new item (duh!). The great thing about this however is that this command can be used to create files, registry entries, websites in IIS. This works by allowing you to browse all these things just as you would a file system. e.g. you can "cd" into IIS and treat it just like you would files on disk.

Really an eye opener into what a modern shell should be like

Re:Fish shell 2.0 by ch_123 on Saturday May 18, 2013 @02:50PM (#5729893)
"Every command is of the form Verb-Noun. Which means you can get off the ground really quickly, as there are only about 15 different verbs. This means you can often guess what you want, even for commands you've never used."

Sounds quite a lot like VMS' DCL, which is similarly intuitive, albeit overly verbose at times.

Re:Fish shell 2.0 by WickyNilliams on Tuesday May 21, 2013 @11:38AM (#5744388)
Just had a look at it, you're right there's definite similarities between the two. I guess someone at MS had a soft spot for DCL!
Re:Fish shell 2.0 by yareally on Friday May 17, 2013 @07:42AM (#5723702)
What's wrong with cygwin (just curious what you dislike about it)? It's fine if you're just trying to do linux based stuff on Windows. It's much more complicated if you are trying to work with the Windows subsystem though. If that is your complaint, I would generally agree, but trying to integrate POSIX on the Windows object like model is not an easy task and what Powershell was made to try to do instead (as best it could since Linux is configured by text files mostly and Windows is Objects). Here's a great comment[1] by one of the developers of Powershell explaining why it is the way it is.

If you dislike using it directly through cmd.exe due to the abysmal UI (as I do), there's alternatives that let you use it with putty[2] and leave cmd.exe interface all together.

[1] http://stackoverflow.com/questions/573623/powershell-vs-unix...

[2] http://www.9bis.net/kitty/?page=PuTTYCyg

Re:Fish shell 2.0 by acron0 on Friday May 17, 2013 @07:50AM (#5723724)
It's not so much that there's anything wrong with it, but it feels like a shim. Functionally, it's awesome, but it could do with sex-ing up a bit. I'm just envying the fact that Fish appears to have style; it's pretty. I like pretty.
Re:Fish shell 2.0 by barrkel on Friday May 17, 2013 @08:45AM (#5723925)
There is almost zero difference functionally or appearance-wise between my Cygwin shell (running in Console2) and my work Linux shell.

Linux is much faster, primarily down to how reliant the Unix way is on forking and how much work Cygwin need to do to emulate that on Windows, but it's only noticeable when working with a lot of data that spawns O(n) processes.

Such scripts can often be rewritten as shell pipelines that don't scale in the same way. E.g. instead of running grep once per file, do xargs grep and filter by filename prefix if necessary; or instead of running mv once per file for renaming multiple files, convert to equivalent CMD syntax and output to a temporary batch file, and run the batch file.

I've got a number of scripts like these, implemented once for the Unix way, and again for Cygwin. But they don't come up all that often, and I haven't had to write one in years.

Re:Fish shell 2.0 by yareally on Friday May 17, 2013 @08:03AM (#5723762)
Try kitty + puttycyg with cygwin (or alternatively, just puttycyg[1], but it's no longer maintained and not as feature rich, but still works). I think that is what you're looking for from my own experience. You'll get all the features of putty and a 256 color terminal if you enable it, plus utf8 support. No local sshd required (I used to just ssh locally into cygwin with its built in sshd before I found puttycyg and kitty).

[1] http://code.google.com/p/puttycyg/

Re:Fish shell 2.0 by mateuszf on Friday May 17, 2013 @08:00AM (#5723753)
cygwin + mingw + zsh looks quite good to me. Been using this for few years now.

EDIT: I meant mintty .. it is small, pretty and configurable.

Re:Fish shell 2.0 by tezza on Friday May 17, 2013 @08:36AM (#5723881)
Take a look at mintty: http://code.google.com/p/mintty/
Re:Fish shell 2.0 by mutewinter on Friday May 17, 2013 @07:29AM (#5723677)
I've often wondered that too. Console2[1] is the best alternative I've found for cmd.exe. Mintty[2] is a decent alternative to Cygwin.

[1]: http://www.hanselman.com/blog/Console2ABetterWindowsCommandP...

[2]: https://code.google.com/p/mintty/

Re:Fish shell 2.0 by andrewaylett on Friday May 17, 2013 @10:36AM (#5724573)
Mintty isn't an alternative to Cygwin, it's a part of Cygwin: an alternative to the standard windows terminal that Cygwin used to launch by default. Recent Cygwin installers actually set up Mintty by default.

You seem to be confusing terminals (programs that provide a text environment) and shells (usually text-based, often run inside a terminal). Mintty is a terminal. cmd.exe is a shell, but will spawn Windows' own ANSI terminal when asked. Cygwin's bash will also spawn Windows' own terminal when run without one. Fish is a shell, and needs to be run inside a terminal.

Console2 is different again. As I understand it, it wraps Windows' terminal, providing some extra features.

Re:Fish shell 2.0 by gecko on Friday May 17, 2013 @07:34AM (#5723686)
Why does PowerShell not qualify? Or are you merging cmd.exe with the Windows console subsystem?
Re:Fish shell 2.0 by dietrichepp on Friday May 17, 2013 @07:41AM (#5723699)
I wonder why PowerShell isn't more... default.
Re:Fish shell 2.0 by oddthink on Friday May 17, 2013 @08:27AM (#5723841)
For me, it's not compatible enough. At work we have a few batch scripts that set up the path and set some environment variables, so we can launch compiles/tests/etc with a short command. These work under cmd.exe, but not under powershell. I keep meaning to experiment with powershell, but never quite enough to overcome that initial barrier. (I'm 95% on Linux, so it's not as if improving my windows workflow would make a big difference.)
Re:Fish shell 2.0 by shadowfox on Friday May 17, 2013 @09:28AM (#5724165)
Turns out that the batch file thing is a fairly common issue.

If you install the Powershell Community Extensions (PSCX), a pretty useful Powershell module in general, it has a command (Invoke-BatchFile) to execute a batch file and propagate the environment changes back to powershell. (While this is not always sufficient; I have found it to be enough for most purposes)

Re:Fish shell 2.0 by dietrichepp on Friday May 17, 2013 @06:50PM (#5727076)
If you're 95% on Linux, you might like PowerShell just because it's a bit more familiar. You can run 'ls' and 'rm -r somedir' just like you're used to (although with quirks, 'rm' only takes one argument, but the argument can be a wildcard... which is expanded by rm, not the shell). I'd say I spend 98-99% of my time in Linux or OS X + zsh, and during my 1-2% time on Windows I was using MSYS until I found PowerShell.
Re:Fish shell 2.0 by shocks on Friday May 17, 2013 @09:19AM (#5724109)
Try clink[1]. It brings some powerful aspects of Bash to cmd.exe.

1: https://code.google.com/p/clink/

Re:Fish shell 2.0 by dcre on Friday May 17, 2013 @10:50AM (#5724657)
It's a little complicated, it's also possible to use iPython, an enhanced Python interpreter, as a shell quasi-replacement on Windows. (It's even more powerful in combination with PowerShell.) Features:

It has tab autocompletion. You can send commands directly to the underlying system shell with '!' (e.g., !dir) and save the result in a Python variable for manipulation (a = !dir). It has special commands called "magics" that let you do neat stuff that the standard shell doesn't, like time how long things take to run. It has a robust command history.

What this means is you can write Python code as your shell scripting language.

Re:Fish shell 2.0 by mariusmg on Friday May 17, 2013 @09:07AM (#5724048)
ConEmu . Also ConEmu + Powershell = god mode on Windows.

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

Re:Fish shell 2.0 by bliker on Friday May 17, 2013 @09:09AM (#5724060)
Love the Quake mode on ConEmu. (roll window down from top)
Re:Fish shell 2.0 by brudgers on Friday May 17, 2013 @10:33AM (#5724562)
The more interesting question is why doesn't 'nix have Powershell and a layer of abstraction upon which it can sit equivalent to the CLR?

Perhaps to be files all the way up is a limitation of the bazaar - at least until one hits the JVM, hopefully. There's no contract assuring that level of abstraction between the user and the turtles. And agreement that such a layer of abstraction is a good thing is unlikely to be forthcoming.

Re:Fish shell 2.0 by zokier on Friday May 17, 2013 @08:45AM (#5723927)
MSYS-style environments deserve a mention too. Git for windows includes a usable enough bash, with nice integration with explorer context-menu.
Re:Fish shell 2.0 by jeremyjh on Friday May 17, 2013 @11:17AM (#5724816)
Yes I have to use Windows at work and I use MSYS. It doesn't have "everything" like cygwin, but everything is a native win32 application and interop is much better. I do use their bash but mostly use cmd.exe with all the MSYS binaries in my path, so I ls and grep and tail all I want and also still use other native windows command-line programs seamlessly. The bash will interop with some programs but not everything.
Re:Fish shell 2.0 by danbmil99 on Friday May 17, 2013 @03:42PM (#5726338)
I would gladly donate $100 to anyone working on a cygwin fish port
Re:Fish shell 2.0 by digisign on Saturday May 18, 2013 @02:05PM (#5729741)
There has been one for about twenty years called 4NT, now tccle.