6

I'm developer who was "born and bred" on Linux and BSD systems, and I've become accustomed to having advanced tools for the console (posix shells like bash, for example). My career has taken a twist that means I'm working in a Windows environment most of the time, and the console capabilities are really poor by comparison. The traditional windows console environment is a complete joke, and even most of the third party attempts at improving things aren't a lot better. PowerShell is a huge step in the right direction, but the console applications themselves are still way behind where unix has been for 20 years.

Does anyone know of a PowerShell console application that supports advanced command line editing like posix shells do? I'm particularly interested in emacs-mode editing, and I'd also like to be able to resize my window to an arbirary size, unlike the native console app that comes with Windows.

Ben Collins
  • 1,020

6 Answers6

9

Not exactly what you're asking for, but have you considered Cygwin? You'll feel right at home.

You can also run PowerShell as a shell within emacs.

3

It's not emacs, but vim has a console version.

Haven't used it on windows, so can't comment on its usability, though.

Vim (console version)

Apart from that, these make cmd a little more enjoyable.

Console2
PowerCmd

Rook
  • 24,289
1

After all this time, I have finally found a solution I like: ConEmu + Clink. And not just ConEmu, but Ethan Brown's ConEmu config:

enter image description here

This can be installed through Chocolatey. I highly recommend this configuration; ConEmu is great, but configuring it to something that looks nice is a chore. Here's how you install

PS> choco install EthanBrown.ConEmuConfig

Also, note that I'm using Clink as well, which provides a GNU readline-like line editing capability which I am thoroughly enjoying. Clink is available like this:

PS> choco install Clink

The Clink installer will edit your $profile for you to inject it into the running host process.

Ben Collins
  • 1,020
0

There is PowerGui.

My impression is that there are not many alternatives to the built-in PowerShell ISE.

With VBScript people used to write to me every other week with a new Editor, but with PowerShell - no offerings.

Guy Thomas
  • 3,348
0

You can dynamically adjust your window size by manipulating the $host.ui.rawui.WindowSize property.

Use a function like this in your profile

Function Set-WindowSize { 
Param([int]$x=$host.ui.rawui.windowsize.width, [int]$y=$host.ui.rawui.windowsize.heigth)

$size=New-Object System.Management.Automation.Host.Size($x,$y)
$host.ui.rawui.WindowSize=$size
}

Then call the function:

Set-WindowSize 100 50

There's a lot you can do right from the console, for example, creating functions on the fly:

PS C:\> Function Try-Me {
>> write-host "Hello $env:username"
>> get-date
>> }
>>
PS C:\> try-me
Hello Jeff

Monday, November 09, 2009 1:08:13 PM

PowerShell's cmdlets can also do so much more. What used to take a 20 line script can now be accomplished with a one line PowerShell expression. Finally, because PowerShell is an object-based shell, you'll get much more out of a scripting IDE like PrimalScript, than merely editing text in the console.

Gareth
  • 19,080
0

The best you can get is if you install ConEmu and clink or go the Cygwin route.

BTW. I like how you call cmd.exe a joke and it being over 20 years behind linux - I feel the same way and actually think about moving to Linux for great console and scripting experience plus all my favourite IDEs and tools are there already (WebStorm, PyCharm, Vim, python, nodejs, Firefox, etc.) the only things I'll miss are Total Commander and AutoHotKey.