aspose file tools*
The moose likes Meaningless Drivel and the fly likes Enter in place of ctrl+c Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Enter in place of ctrl+c" Watch "Enter in place of ctrl+c" New topic
Author

Enter in place of ctrl+c

Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1281

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 ??


No Kaustubh No Fun, Know Kaustubh Know Fun..
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Sep 20, 2010
Posts: 3649
    
  17

Sometimes I wish Enter was used as the abort command for some people :P
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2861
    
  11

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
Bartender

Joined: Jan 17, 2008
Posts: 2434
    
  28

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

Joined: Aug 16, 2005
Posts: 14350
    
  22

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

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

Joined: Sep 20, 2010
Posts: 3649
    
  17

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

Joined: Aug 16, 2005
Posts: 14350
    
  22

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

Joined: Jan 21, 2002
Posts: 56

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

Joined: Aug 11, 2007
Posts: 4659
    
    5

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enter in place of ctrl+c