Live data from Hacker News

How bad is the Windows command line really?

blog.nullspace.io

81–90 of 110 posts

Re: How bad is the Windows command line really?

#81

Earlier quoted context omitted.

> Turn on Quick Edit. Now drag to select and right click to copy. Command line + mouse = GUI, not command line.

I'm curious, how do you copy and paste in Bash without a GUI?

Ok then, how do you copy and paste without using a mouse in Bash?

Edit: this is in reply to the comment at the same level of this one, can't hit reply on it

Re: How bad is the Windows command line really?

#82
post #55

It's really, really, really, really really bad. It doesn't even have a logical history. Despite having used it for many years, I still don't understand why when I type one command (eg make), and then another (eg out.exe), I have to toggle between pressing up or pressing down from the new command-prompt to access the previous commands. I can't make the window more than 80-characters wide dynamically. (I don't want to…

I still don't understand why [..] I have to toggle between pressing up or pressing down from the new command-prompt to access the previous commands.

It is because the shell history has its own completely invisible cursor, and the cursor is not reset after a command. So when you press three times, then press , your history cursor is still at -3 (actually, -4). If you then want to move to command -2, you need to press instead of .

The real fun comes when you edit commands in your history (so press , then edit the command line). I'm still not quite sure how Microsoft handles that.

Re: How bad is the Windows command line really?

#83
post #55

It's really, really, really, really really bad. It doesn't even have a logical history. Despite having used it for many years, I still don't understand why when I type one command (eg make), and then another (eg out.exe), I have to toggle between pressing up or pressing down from the new command-prompt to access the previous commands. I can't make the window more than 80-characters wide dynamically. (I don't want to…

https://conemu.github.io

Re: How bad is the Windows command line really?

#84

Personally, one of the reasons why I fell in love with Ruby 10+ years ago was because I realized I could use it instead of CMD or bash to write all my scripts from now on. Regardless of the platform. Obviously, this applies to Python as well if that's more your thing. I've never gotten into PowerShell but I have absolute respect for the concept behind it, and how much more advanced it is than any shell you can find o…

> you are now piping real language objects Which is in fact a bad idea, because in order for stdin to accept objects and stdout to output objects, now those commands have to be powered by PowerShell and .NET. In other words you're in a very finite and closed environment that does not interoperate with the outside world. You know, love or hate Unix, but the fact remains that this family of operating systems, including…

It interoperates just fine. That's what's great about powershell, when you're working with objects on the pipeline you have a ton of power at your command, and you can write very expressive code that is compact. But at the same time, outside of that context it's just plain text. It's win/win.

Re: How bad is the Windows command line really?

#85

Earlier quoted context omitted.

I'm curious, how do you copy and paste in Bash without a GUI?

Ok then, how do you copy and paste without using a mouse in Bash? Edit: this is in reply to the comment at the same level of this one, can't hit reply on it

can't hit reply on it

There's an anti-flamefest delay on comment threads: you can't reply to comments younger than a few (5?) minutes. However, if you go to the comment directly (click on the timestamp next to it), you do get the option to reply immediately.

Re: How bad is the Windows command line really?

#86

I usually write shellscripts in PHP. Works pretty good, and PHP is by far easier to write than either bash scripts or Windows shell script - not to mention that one single syntax can be used for both OSes, which is nice when you do development on both Linux and Windows, and even nicer when you're also developing on OS X which ships a horribly outdated bash (and other coretools).

I am by no means a PHP hater (I do some PHP dev for work) but PHP not only has multiple versions (4, 5, 5.3) but has a ton of modules for everything (curl, mbconv, openssl, etc) that have to be setup the same way for you to get the same behavior across OSes. Not sure it makes a great shell script for that reason.

Re: How bad is the Windows command line really?

#87

Earlier quoted context omitted.

Bash first came out in 1989, but the typical shell of the time was sh, and it ran on Unix systems with more memory, storage, and CPU power than the typical PC. Thus it's no surprise that the sh family started with more features, while COMMAND which cmd evolved from was extremely minimalistic. DOS 1.0's COMMAND.COM was just slightly more than 3 kilobytes and didn't have conditional nor goto statements: http://www.os2m…

Even if the *nix machine was no bigger than a PC (e.g. - Xenix on '286; BSD on a PDP-11), it could still swap out processes, vs sharing a single real memory space. But as you said, this allowed (at least the illusion, on some machines) more total memory to work with.

In the 1980's a 80286 would have been toward the high end of x86 systems. The 80386 started shipping in bulk in 1986 and the Compaq DeskPro 386 and IBM PS/2 Model 80 were well north of $5000 in 1987 and the "prosumer" PS/2 was the Model 60 with a 80286 when the line was released.

Even in the late 1980's 8088 based systems were pretty typical and why IBM included the PS/2 25 and 30 in its initial product line.

Re: How bad is the Windows command line really?

#88
post #15

Agree about Windows command prompt being lame compared to bash, but I really find PowerShell amazing, even more so then bash. If you look at all the recent (even not so recent) products from MS, it is clear that PowerShell is the shell for Windows, and not batch. I didn't get the cure for polio analogy that's in the article but I really think anyone that's comparing shells should compare with PowerShell.

Powershell the language is ok, Powershell the interactive shell is still lacking. Here's what I still need:

* usable tab-completion: scrolling through all available cmdlets is a poor substitute, and usually increases my keypresses instead of decreasing it.

* workable history editing: if I edit a previous command, I must remember to never use tab completion again, because pressing halfway in a command erases everything following the cursor

* consistent interface: In a powershell shell window, I can use left mouse button to select and copy, right mouse button to paste. In command shell window, I must use right mouse button to select "Mark" in context menu before even left-mouse selection works. In powershell ISE, left mouse button selects but does not copy, right mouse button still opens a context menu.

Re: How bad is the Windows command line really?

#89

Earlier quoted context omitted.

> Turn on Quick Edit. Now drag to select and right click to copy. Command line + mouse = GUI, not command line.

I'm curious, how do you copy and paste in Bash without a GUI?

Let's say you want to copy and paste something from an earlier command line entry and put it in a new command line entry:

  % set -o vi
  % # hit ESC to go into vi cmd mode, hit k a few times until
  % # you get to this old command in your command history:
  % longasscommand -with -params -i super.dont -w ant2 -type in -again
  % # you want just the stuff from -params to ant2, so you
  % # type "f-n" to get the cursor to -params, then "yf2"
  % # to copy everything from there to -w ant2
  % # now you type j a couple times to go back down to
  % # the line you were working on:
  % longasscommand -with -oh jesus -not this.shit -again
  % # now you hit "f-nn" to put the cursor on the -not
  % # type "dW." to get it just so:
  % longasscommand -with -oh jesus -again
  % # now you're ready to paste in your copy after jesus
  % # so you type p, and it's inserted where you left the cursor:
  % longasscommand -with -oh jesus -params -i super.dont -w ant2 -again
You can use screen or tmux to copy and paste from anything on the screen, including using the mouse. It's really out of the purview of bash, tho.

Really handy tools on the Mac are pbpaste which sends any text in the system clipboard to stdout and pbcopy, which you can prolly guess at.

Re: How bad is the Windows command line really?

#90
post #78

Earlier quoted context omitted.

I agree it's pretty bad. But... > I can't make the window more than 80-characters wide dynamically. Windows 10 fixes this. You can resize the window and it wraps text better than any other terminal out there. > Copy-and-paste as well is just complete garbage that takes forever. Turn on Quick Edit. Now drag to select and right click to copy. > There's no tab-completion. Tab completion for filepaths works quite well fo…

> Windows 10 fixes this. You can resize the window and it wraps text better than any other terminal out there. Don't want to derail with Windows 10 arguments, but for me, that's a total deal breaker at this time. But thanks for pointing it out! Now if I find out Windows 10 can handle LF-formatted text in Notepad, I'll have to check and see if Hell froze over :P > Turn on Quick Edit. Now drag to select and right click…

>Don't want to derail with Windows 10 arguments, but for me, that's a total deal breaker at this time.

I'll bite. What's holding you back? Ever since 7 / 8.1 got telemetry backported in, they're on equal footing with 10 from a privacy standpoint. I guess you could cherry-pick out which windows updates you want to install, but that's frankly unsustainable.

You may as well get the new WDDM, the new DirectX 12, the new virtual desktop support, the new command prompt, and all of that.

>if I find out Windows 10 can handle LF-formatted text in Notepad, I'll have to check and see if Hell froze over :P

It doesn't, and it hasn't :P

Love your work by the way. bsnes/higan is a significant contribution to the human race.

Post reply on HN