Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How about Ctrl+C? The meaning is unambiguous: If there is a selection, Ctrl+C is handled by the console host and copies the selection. If there is no selection, Ctrl+C is passed on to the running program which then does whatever it likes with it (i.e. in many cases terminate itself).


Your suggestion makes sense, but my previous question was referring to how Windows handles this. Do you know if it's possible to assign Ctrl+C to both operations for the Windows 10 command prompt?


That was a description of how Windows handles this. Basically, the current selection and those capabilities are part of the console host. Your application running in a console window has (to my knowledge) no idea of those features; it cannot tell whether there is a selection or not or what to do with it because they happen transparently a layer above your application (between your application and the window manager, essentially).

So the question you're asking is a bit moot, in a way, considering that the answer is yes, because that's exactly the way it is. It cannot be any other way, as far as I can see.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: