Live data from Hacker News

A Saner Windows Command Line

futurice.com

51–60 of 164 posts

Re: A Saner Windows Command Line

#51

No mention of clink ? surprising, cmd.exe meets readline. Highest ROI 'update' I know on Windows https://mridgers.github.io/clink/

ConEmu plus clink is my mitigation of choice.

Line oriented copy/paste, instead of cell oriented, is a big win.

Re: A Saner Windows Command Line

#52
post #20
post #8

Earlier quoted context omitted.

> The script was 11 lines long (vs 3 lines in Python), it was harder to read and understand. Note that this might be true for one script, and the opposite might be true for another script. Something is saner in bash, something is better in PS. They have fundamental differences (text- vs. object-based), and neither of them is better than the other in all scenarios. (At least that's my experience.)

I think it's worth noting that powershell is .NET object-based. This means you can interact with powershell objects from a .NET language but not, for example, python. To me this is the fundamental flaw of PS. It's a neat idea as long as you stay within their box, within their ecosystem. With Bash you get a wealth of tools because everything can handle text.

Yes, but the downside of that is you have to munge the text to do things with it, while with .NET objects you often don't have to do that. And PowerShell certainly does provide facilities for dealing with text, so you can use other languages' tools within PowerShell (and I think with some use of Out-String and similar you could go the other way well enough).

Re: A Saner Windows Command Line

#53
post #12

Powershell and its long winded cmdlets are really hard for me to like. I always fall back to cygwin on windows. I once wrote a PS script to set some power management options on a corporate laptop. The script was 11 lines long (vs 3 lines in Python), it was harder to read and understand. Even with ISE available it was much harder to write. I followed along with some exchange server tutorial where the prescribed easy w…

Without seeing the script, it's hard to make judgement. Powershell has a ton of alias(Use Get-Alias to find them) and shortcuts, but most people don't use them.

I think most people discourage their use in scripts, which is understandable if you want to maintain the script easily.

Re: A Saner Windows Command Line

#54
To hear bash-people to call Powershell "non-intuitive" sounds like those immigrants that go to a foreign land, refuse to learn the local language and insist on the natives to understand their immigrant language. Or like programmers that think that every programming language should have the C syntax.

Bash and Unix commands are only "intuitive" after years of practice; Powershell is not different. And it doesn't have any obligation of being equal to bash.

Re: A Saner Windows Command Line

#55
post #19

I tried both ConEmu (twice) and Console2 in the past, but both were too unstable for regular use. If someone can convince me that the situation has markedly improved, I might try again, but I guess I'll just wait until we upgrade to Windows 10 at my workplace (which they say is any day now).

Happy ConEmu plus clink user for at least a year, I suspect more, but I don't keep track, I just move on.

Re: A Saner Windows Command Line

#56

>> Let's be honest. What many people think of as "the default Windows command line", cmd.exe, is atrociously bad. Selection is awkward, resizing is hard, the syntax is arcane, the list goes on. If you do nothing else, there are two things you can do to make the basic, vanilla experience bearable. Funny, from a guy coming from Windows to Unix I think the exact opposite. Each command comes with a bazillion options and…

Are you on Solaris? ^H is ancient history and not a thing on Linux.

Re: A Saner Windows Command Line

#57

Earlier quoted context omitted.

> Some of it stems from the fact that i just don't use it enough, but most of it from the fact that this shit just isn't intuitive. I have exactly the same problem. I use Linux since about 8 years but somehow I just don't use the commandline very often so I forget stuff all the time. Because of this I have half a dozen post-its glued to my monitor for all the grep/git/whatever tricks I just can't keep in my head. And…

Holy shit git! I need to reset my git repo to match origin, is it git reset hard --HEAD or git reset HEAD --hard? I'm like 90% sure they switch it with every update.

You can just leave out HEAD since it is implied, but understanding a little bit about git, like what the head is supposed to be, would probably help you.

Re: A Saner Windows Command Line

#58
post #50

>> Let's be honest. What many people think of as "the default Windows command line", cmd.exe, is atrociously bad. Selection is awkward, resizing is hard, the syntax is arcane, the list goes on. If you do nothing else, there are two things you can do to make the basic, vanilla experience bearable. Funny, from a guy coming from Windows to Unix I think the exact opposite. Each command comes with a bazillion options and…

> I don't want to be logged into some terminal and have the Backspace not behave like a backspace (^H??). Yes, I'm sure I can make it work via some, again, configuration magic or enter emacs mode, but, again, why? You don't have to do any magic for that normally. Even if using just xterm with bash, backspace should behave like backspace almost everywhere. You had some weird configuration there – possible you used the…

I think you're correct on this one. I ran into this issue once and it was some silly, easily fixed issue. Sadly I don't remember what it was.

Re: A Saner Windows Command Line

#59
post #2

At our office we jokingly refer to powershell as "two googles per line" - a term coined by its strongest proponent at the company. It thought it would come naturally over time, but it never does. It seems needlessly cryptic and verbose in so many ways. I've started using LinqPad for stuff I would normally do in cmd now.

I don't really understand this- I always found the "get-help" commandlet to be sufficiently informative, unless they were using parts of the .NET framework that I wasn't already familiar with, in which case I needed to go read about those objects/etc. on my own. Is this that bad?

I guess it won't help if you don't know what cmdlet you want to use.

Re: A Saner Windows Command Line

#60
post #19

I tried both ConEmu (twice) and Console2 in the past, but both were too unstable for regular use. If someone can convince me that the situation has markedly improved, I might try again, but I guess I'll just wait until we upgrade to Windows 10 at my workplace (which they say is any day now).

ConEmu does seem to have gotten a lot more stable in the last few months

I'll confirm this. During a previous project, it would sometimes crash, or history would get wonky, but I've not seen any of those behaviors while working on my current project. I generally am just using the terminal to run tasks, so I'm not sure I qualify as a "power user."
Post reply on HN