Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enter in place of ctrl+c

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Why Enter key is a short cut for copy command it DOSS command prompt instead of famous Ctrl+c ?? Is Ctrl+c used for some other command ??
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In windows command line, some time I use ctrl+c to abort/terminate current running task for instance, while tomcat is running...
 
Stephan van Hulst
Bartender
Pie
Posts: 5408
52
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometimes I wish Enter was used as the abort command for some people :P
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Ctrl-C terminates console programs so isn't appropriate for copying text. That's why Macs use Command-C instead. It's somewhat annoying when you're switching from Windows to Mac, but when you're focused in on Mac work, it's so nice that the same method works everywhere. I believe the Enter on a Windows command session actually only works if you've got Quick Edit enabled. Otherwise, you have to choose Mark and Copy from the menu. The problem with Quick Edit is that if you highlight text in the command window and leave it highlighted, the process producing that output can often block waiting for you to press Enter.
 
Jayesh A Lalwani
Rancher
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah I don't know why they didn't do it like Linux:- Selecting some text = copy. Why make users press a button?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, you want to know why. Ofcourse all of this is for historical reasons, because somebody long ago invented that Ctrl-C should be used to stop programs, and later somebody else thought it was a good idea to use Ctrl-X, -C, -V for cut, copy and paste.

Control-C

Wikipedia wrote:In graphical environments

Ctrl-C was one of a handful of keyboard sequences chosen by the program designers at Xerox PARC to control text editing, with Ctrl-Z (Undo), Ctrl-X (Cut), Ctrl-V (Paste), and Ctrl-P (Print). The first four letters are all located together at the left end of the bottom row of the standard QWERTY keyboard, and P towards the upper right. The equivalent key combination on Mac OS computers is Command-C.

In command-line environments

Control-C as an abort command was popularized by TOPS-20 and TOPS-10 and adopted to other systems including Unix, and Digital Equipment operating systems from which it was copied to CP/M and thus to MS-DOS and Microsoft Windows. In POSIX systems, the sequence causes the active program to receive a SIGINT signal. If the program does not specify how to handle this condition, it is terminated. Typically a program which does handle a SIGINT will still terminate itself, or at least terminate the task running inside it.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Wikipedia entry is mostly right. I don't know if ^c predated TOPS-10 (the first OS that ran on PDP-10 hardware), but it was there when I started using Tops-10. And Tops-20 included it. So then VMS (the Vax OS) included it, as did several other DEC operating systems such as RSX-11.

RSX-11 was created by a team that included David Cutler, who did early VMS work (since VMS was based on RSX-11. And then Cutler moved to Microsoft and was the father of Windows NT. Early NT designs did not include any GUI, so there was no problem.

Early Unix systems ran on DEC hardware, and so they followed the tradition and used ^c to stop programs.

Its not accurate to say that ^c is copy in Linux, as it varies, sometimes its ^c, sometimes ^-shift-C and sometimes one of the hotkeys over on the ten key pad (which never has just 10 keys).
 
Stephan van Hulst
Bartender
Pie
Posts: 5408
52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayesh A Lalwani wrote:Yeah I don't know why they didn't do it like Linux:- Selecting some text = copy. Why make users press a button?


I know I would be very unhappy if I lost my clipboard every time I accidentally selected something.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Ubuntu (Linux) every day and I've never noticed that "select some text = copy". So I wonder what you mean exactly.
 
David Mason
Ranch Hand
Posts: 56
Android Chrome Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you connecting to your Linux box via putty - using left mouse click - drag - release to highlight text on my putty session = copy in that you can use right click to paste it
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Mason wrote:Are you connecting to your Linux box via putty - using left mouse click - drag - release to highlight text on my putty session = copy in that you can use right click to paste it


@dave brings up a key concept: its not just the server OS that defines this action. It can also be the client software (putty, OS-X bash shell, etc.)

When I use my Mac to connect to my Debian servers, the Mac-style command-c works and not the normal Debian conventions.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic