• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Enter in place of ctrl+c

 
Ranch Hand
Posts: 1283
Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ??
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Saloon Keeper
Posts: 15490
363
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sometimes I wish Enter was used as the abort command for some people :P
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Rancher
Posts: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Saloon Keeper
Posts: 15490
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 56
Android Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4803
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic