News for hackers. Stuff that matters.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by dvh on Friday November 18, 2016 @08:42AM (#12986652)
Btw did anyone noticed that in windows 10 you can resize cmd.exe to more than 80 characters width! When I first saw it I almost cried.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by jkn on Friday November 18, 2016 @10:23AM (#12987333)
IIRC you could resize the standard cmd console easily, just type "mode 160" (or whatever width you want). I don't have a Windows installation around to check it, but maybe someone can confirm?
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by erikbye on Friday November 18, 2016 @10:27AM (#12987358)
Yes, that is correct.

Display mode: MODE CON[:] [COLS=c] [LINES=n]

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by orbitingpluto on Friday November 18, 2016 @05:54PM (#12990747)
Hey!!! This works in PowerShell (non-ISE)!!!! Breaks my 112 column limit, despite a default setting of 200.

Added this to the end my Microsoft.PowerShell_profile.ps1 in my $HOME\Documents\WindowsPowerShell directory. (run: "notepad $PROFILE" in PS)

  MODE CON COLS=200
  Clear-Host (I get some artifacts)
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by erikbye on Saturday November 19, 2016 @05:46AM (#12992856)
All functionality used to reside in conhost.exe, no matter which character mode application you used (command prompt or PowerShell), which is why a lot of commands would work for both character modes. This is not how things work now (though a lot of commands are still shared, like “mode 120,120”) as conhost.exe now just decides if it should give you the legacy console host or the new one (with things like buffer improvements and word wrapping).

There are a lot of subtle improvements I think many are not aware of, like, if you paste in text with smart quotes they will be changed to straight quotes.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by orbitingpluto on Saturday November 19, 2016 @08:41PM (#12996800)
One of those subtle improvements is honoring a Ctrl-L. I like to be able to clear the screen like that.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by mfukar on Friday November 18, 2016 @10:59AM (#12987627)
TIL. Thanks very much.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by shawnz on Friday November 18, 2016 @01:59PM (#12989164)
You could also previously use the console properties page (accessible from the system menu of the console).
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by taneq on Friday November 18, 2016 @11:06AM (#12987679)
Huh. Apparently yes. I think I'm in love with you now. Carry on.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by pmoleri on Friday November 18, 2016 @09:28AM (#12986951)
And you can use Ctrl+C Ctrl+V :) If you upgraded from a previous Windows you need to disable legacy mode.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by kels on Friday November 18, 2016 @11:07AM (#12987688)
Thanks for this. I upgraded and was wondering why I couldn't Ctrl+C/V vs one that was a fresh install.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by hobarrera on Saturday November 19, 2016 @01:38AM (#12992366)
So no Ctrl+C to bail out of apps? Is there an equivalent?
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by y4mi on Friday November 18, 2016 @01:02PM (#12988671)
most of the other shortcuts don'T work though.

i miss ctrl-d for example

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by nailer on Friday November 18, 2016 @10:27AM (#12987355)
Most Windows terminal people use ConEmu rather than the inbuilt terminal apps - it's like iTerm2 vs Terminal.app on MacOS. ConEmu adds Unix style cut and paste, tabs, etc. Add openssh, PSReadLine and PSCX and you've got a proper terminal setup.

Also MS should really improve the inbuilt apps to do this stuff.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by nneonneo on Friday November 18, 2016 @11:01AM (#12987638)
I've used iTerm and Terminal on Mac, and the default Windows Terminal (conhost), PuTTY sand MinTTY on Windows.

Terminal.app is much, much better than conhost, even after the Windows 10 update. It's fast, supports a ton of thoughtful features (such as customizable title bars via extended ANSI codes, real line wrapping during resize, good Unicode support from the very beginning, etc.). With Terminal.app I can be quite happy and productive even with someone else's Mac or with the default settings. I've used iTerm2 but their features weren't compelling enough for me, and the iTerm font rendering is noticeably worse in many ways. Apple has also been very good about giving Terminal.app continuous updates.

On Windows though I have almost always had to install MinTTY or something just to get a halfway usable terminal emulator. The default emulator is just so limited - Unicode support is very plug and pray, the title bar is totally locked, and having to use Windows APIs to change text formatting is a pain. Conhost is also amazingly slow when it comes to large amounts of text, so much so that printf can be extremely detrimental to program performance just because it has to wait for the terminal window to catch up.

PowerShell's terminal experience is better but not quite there. And, PS suffers from extremely long load times - I've seen it take upwards of 10 seconds to start without any extensions. That means that in practice I often pop open cmd.exe even if PS is a better choice, just because I don't want to sit through a long load time.

Microsoft really should get their Terminal story in order. I'll definitely try out ConEmu the next time I sit in front of a Windows box, but like you I wish MS would improve their own apps!

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by brownbat on Friday November 18, 2016 @01:39PM (#12989018)
> good Unicode support from the very beginning

I once started a Chinese character flash card program in Python on Windows.

The yak shaving was unbelievable. I never got a working version, but I learned a lot about code pages, and why "building a console from scratch" is not actually the right answer to "I want to be able to test a toy program I'm making before it's finished."

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by kevin_thibedeau on Friday November 18, 2016 @07:07PM (#12991081)
Tkinter would have given you a basic Unicode capable GUI without the hassles of the console.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by brownbat on Friday November 18, 2016 @07:40PM (#12991227)
Hmm, going back through my old .py files, I ultimately did start using Tkinter... and for some reason thought yaml was really important...

Still, would have been nice to have a program that essentially took in and put out text without learning everything about GUI elements.

I'd never written anything with a GUI before, and "I'd like to see unicode" is a really weird place to dive in.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by bitwize on Friday November 18, 2016 @12:05PM (#12988185)
> PowerShell's terminal experience is better but not quite there. And, PS suffers from extremely long load times - I've seen it take upwards of 10 seconds to start without any extensions.

Small price to pay to be able to pipe objects, man!

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by JeffreySnover on Friday November 18, 2016 @09:03PM (#12991586)
Sorry about that - we lost control of our startup times in PS V3 and have been working to get it back under control. PowerShell V5 had substantial improvements but we keep working on it and V5.1 is even faster. Give it a try - I think you'll like it.

Jeffrey Snover [MSFT]

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by Bombthecat on Saturday November 19, 2016 @03:16AM (#12992565)
I really hope so!

I basically stopped using ps ( for smaller stuff) because the startup tone is so awful.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by nneonneo on Saturday November 19, 2016 @01:42AM (#12992375)
I'm not entirely sure if you're joking or not (one of the hazards of the textual communication medium). Yes, piping objects is fun and occasionally very useful, but waiting ten seconds to pop a terminal so I can run `ipconfig` or something is not so useful.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by throwaway7645 on Friday November 18, 2016 @07:19PM (#12991126)
Are you actually able to not be confused by piping objects? In Unix everything is a string so I just pipe text to sort and then unique...etc. PS always complains relentlessly. The GUI features and .NET integration is nice though.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by hota_mazi on Friday November 18, 2016 @03:47PM (#12989948)
What drove me away from Terminal.app was the fact that I can't use command-1/2/3 to switch tabs. Ctrl-tab doesn't work either.

Did I miss something?

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by thebspatrol on Friday November 18, 2016 @03:57PM (#12990012)
CMD + { and CMD + }
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by hota_mazi on Friday November 18, 2016 @04:48PM (#12990356)
Thanks but... yuck. Any way I can remap these?

Cmd-<number> is a pretty standard way to jump to tabs (and arguably, Ctrl-tab as well).

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by eridius on Friday November 18, 2016 @07:40PM (#12991216)
⌃⇥ actually does work in Terminal.app. And in fact, ⌃⇥ and ⌃⇧⇥ are the official keyboard shortcuts in the menu, with ⌘{ and ⌘} being undocumented aliases. This is also how Safari works too.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by skissane on Friday November 18, 2016 @04:06PM (#12990077)
I wonder why they chose ⌘{ and ⌘} instead of ⌘[ and ⌘]. With the later you don't need to hold down SHIFT (at least on US keyboard layout.)
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by eridius on Friday November 18, 2016 @07:40PM (#12991224)
Because it's the same keyboard shortcuts that Safari uses, and in Safari ⌘[ and ⌘] navigate the history stack.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by scraft on Friday November 18, 2016 @10:37AM (#12987428)
Whilst I am glad to hear about ConEmu; I have to disagree, I use windows cmd.exe very regularly, and know lots of other people that do, and I have never used ConEmu before! I might give it a try now I know about it.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by WorldMaker on Friday November 18, 2016 @10:44AM (#12987486)
Cmder is a good configuration bundle for ConEmu and a better place for new users to start.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by nailer on Friday November 18, 2016 @10:55AM (#12987593)
Cmder seems cool but it's ConEmu + Clink + git for windows.

- Clink is for cmd what PSReadline is for posh.

- posh-git does what git for windows does (I personally don't like git info in my prompt, so use neither, and have a custom, Unixy-one)

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by pixelcloud on Friday November 18, 2016 @04:09PM (#12990094)
ConEmu si really nice simply because you can have tabs, split pane and good color schemes. 've never gotten to the level that some people need, so ConEmu + bash = everything I was using on OSX.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by UK-AL on Friday November 18, 2016 @11:03AM (#12987654)
I highly recommend ConEmu, I've used it for awhile.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by keithnz on Friday November 18, 2016 @03:47PM (#12989950)
con emu makes the linix subsystem shell a lot nicer too, in fact has an inbuilt ubuntu theme that makes most colors sane
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by pjmlp on Friday November 18, 2016 @11:04AM (#12987660)
I use Windows since version 3.1 and never bothered with it.

Properly configuring cmd.exe was enough for me. Then again I only use the terminal on "as required" basis.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by gpvos on Friday November 18, 2016 @11:32AM (#12987923)
It has never been stable for me, so I stick with the console, even though I would like to switch to something better.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by krylon on Friday November 18, 2016 @08:53AM (#12986715)
My work laptop still runs Windows 7 - and will for the foreseeable future - but that is one of the things that make me curious about Windows 10. It is, of course, easy to ridicule Microsoft for how long it took them to change this, but I think better late than never.

(On older versions of Windows, ConEmu[1] does that, too, but it's third-party software, of course. It also supports tabs!)

[1] https://conemu.github.io/

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by yitchelle on Friday November 18, 2016 @10:03AM (#12987179)
Since conemu is mentioned, I'll chimed in with cmder[1]. It builds ontop of conemu and has git-for-windows integrated as well.

[1] - http://cmder.net/

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by aq3cn on Friday November 18, 2016 @12:58PM (#12988640)
cmder developer also says:

> If you have trouble with anything I am happy to help. But you will have much better chances to find solutions on the pages of the upstream projects. Those are:

    Console emulator ~ Conemu (https://conemu.github.io/)

    Cmd.exe enhancements ~ clink (https://mridgers.github.io/clink/)

    Unix tools on windows ~ git for windows (https://git-for-windows.github.io/)
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by krylon on Friday November 18, 2016 @03:34PM (#12989861)
Thank you very much! I'll give that a try!
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by rhapsodic on Friday November 18, 2016 @08:44AM (#12986659)
I've been able to do that in versions of Windows going back as far as I can remember.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by herbst on Friday November 18, 2016 @09:20AM (#12986902)
Correct me if i am wrong, but all i remember is you could edit the width somewhere in the options. But there was no way to change the width _on the fly_ (assuming thats something it does now)
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by beagle3 on Friday November 18, 2016 @09:33AM (#12986991)
Older versions could resize the window with a drag, but the underlying buffer required a menu option, which was very awkward.

In Win10, you can resize the buffer with a drag as well.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by cmdrfred on Friday November 18, 2016 @08:47AM (#12986680)
They made the option easier to find.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by ihalip on Friday November 18, 2016 @08:49AM (#12986687)
I don't remember ever not having that feature, so it must be around ever since XP. Right click window -> Properties -> Layout.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by sapphire_tomb on Friday November 18, 2016 @09:06AM (#12986807)
OP means you can drag the window wider - no need to alter properties anywhere ;)
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by erikbye on Friday November 18, 2016 @10:14AM (#12987260)
Drag-resize (affecting buffer, as well) is nice, finally. And you can change opacity in properties, making your window transparent.

What I really like though: you can now use Shift + arrow keys to select text and C-c/C-p to copy/paste.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by Senji on Friday November 18, 2016 @10:58AM (#12987616)
If you're going to use CMD/PS on windows you might go whole hog and install ConEmu. Then load it up with Cygwin, and DosBox.

ConEmu can even integrate stuff like Putty.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by erikbye on Saturday November 19, 2016 @05:00AM (#12992747)
Thanks for that suggestion. I am well aware of these options, and if I used Windows at home, I could utilize these. However, I only use Windows when I have to, which is at work. The environment in which I work, you can absolutely not install software like this, as you would be breaking security protocols (and the law).

So this explains the joy I feel over small improvements like those mentioned above.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by josteink on Friday November 18, 2016 @01:19PM (#12988832)
> ConEmu can even integrate stuff like Putty.

If you're going to use ConEmu, just go ahead and use the straight & regular OpenSSH command-line ssh tool.

Then you get all the standard niceties you can stash away for global reuse in ~/.ssh/config.

I don't miss PuTTY one bit.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by rocqua on Friday November 18, 2016 @07:21PM (#12991136)
Ooh, could I use this to get ECDSA keys with configurable rounds of hash functions?

I might switch from putty to ConEmu with OpenSSH then. Presuming I can get ConEmu's look close enough to my putty.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by Senji on Saturday November 19, 2016 @12:17PM (#12994372)
ConEmu is endlessly modifiable. You can inject dll hooks into it if you so wish even.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by friendzis on Monday November 21, 2016 @07:12AM (#13004755)
You could do it at least in Win7, maybe earlier, do not have anything older to test with. Click on icon (right click on top bar) --> properties --> layout. You can edit both window size and buffer size
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by aq3cn on Friday November 18, 2016 @12:55PM (#12988611)
It also support transparency and lot more features. Install sysinternals, chocolatey (a package manager, https://chocolatey.org) and python, you are good to go.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by imron on Friday November 18, 2016 @07:16PM (#12991118)
You could do this since at least XP!

You just needed to go in to the properties of the window and increase the screen buffer size (both width and height). It's one of the first things I'd do upon installing a Windows machine.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by alexc05 on Friday November 18, 2016 @11:24AM (#12987843)
I have been waiting for that for years - now if they would only add TABS to real powershell (as opposed to powershell ISE) or if they can add colors to powershell ISE I will be super-duper-bonus happy.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by hashhar on Friday November 18, 2016 @12:24PM (#12988336)
They have 24-bit colour support in the latest Insider build.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by JeffreySnover on Friday November 18, 2016 @09:04PM (#12991593)
We are incapable of sustained error. 25+ years was enough. :-)

Jeffrey Snover [MSFT]

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by zouhair on Friday November 18, 2016 @04:54PM (#12990398)
Alternatively you can use ConEmu[0]

[0]:https://conemu.github.io/

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by rspeer on Friday November 18, 2016 @05:08PM (#12990504)
I've found ConEmu's xterm emulation to be frustratingly buggy if I'm ssh-ing into a Linux machine and running tmux, vim, or really anything with colors or a status bar. mintty [1] works a lot better for me. (mintty is also the console that's packaged with Git for Windows.)

[1] https://mintty.github.io/

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by deviate_X on Friday November 18, 2016 @09:56AM (#12987125)
Lol you could always have done this by setting the command prompt properties -> since at least 3.51 ;)
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by eumoria on Friday November 18, 2016 @09:33AM (#12986987)
also CTRL+V pastes by default now, but yea you're no longer locked into half the screen by default. I wonder why that's been like that for so long? Must be some reason...
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by Already__Taken on Friday November 18, 2016 @09:52AM (#12987105)
Console GUI applications. Pretty much any tweak to conhost ever and they'd implode.

I don't know what's changed now but they've rolled that policy away. Maybe virtualization?

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by Someone on Friday November 18, 2016 @01:27PM (#12988915)
They may have decided that the number of people running console programs with a GUI is low enough now.

I don't know whether it still was necessary, but the removal of support for 16-bit applications from 64-bit Windows 7 will not have hurt there.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by agumonkey on Friday November 18, 2016 @12:38PM (#12988457)
Aren't we glad it's 2016 ?
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by herbst on Friday November 18, 2016 @09:19AM (#12986895)
Seriously? I wonder how they managed to do that, i am sure that required a whole engineer team for a whole month!
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by minikites on Friday November 18, 2016 @09:21AM (#12986914)
https://technet.microsoft.com/en-us/library/dn167709.aspx

> Every idea for a feature starts out with an imaginary deficit of -100 points. That means it has to demonstrate a significant net-positive effect on the product as a whole in order to emerge as being truly worthy of consideration.

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by herbst on Friday November 18, 2016 @09:29AM (#12986965)
That is actually pretty interesting, thanks for linking!

I still dont understand how this was not "fixed" years ago, sure some config windows have fixed widths because it makes sense, but something as a terminal obviously needs the ability to grow (or shrink), especially after they introduced sticky windows and people actually used "tiling"

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by to3m on Friday November 18, 2016 @11:17AM (#12987774)
The idea that the console screen is an MxN matrix is pretty embedded in the API... it's not a MDA display adapter metaphor, not a Unix-style typewriter. I'm guessing they just felt they had bigger fish to fry.

(Everybody I know that uses the console window a lot has always just set the window to 120x9999 or 160x9999 or whatever and forgotten about it. It's one of those things that's obviously kind of lame, but after a while you just forget about it.)

Re:Microsoft Replaces Command Prompt with PowerShell in Late... by dboreham on Friday November 18, 2016 @10:00PM (#12991818)
Odd, I've always set it to 132.
Re:Microsoft Replaces Command Prompt with PowerShell in Late... by to3m on Friday November 18, 2016 @07:56PM (#12991324)
Oops... it IS a MDA metaphor!