Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I*am using Kubuntu 10.04. I would like to change some of the standard shortcut keys for bash (terminal).
I want:
Ctrl-C to copy the selected text to the clipboard.
Ctrl-V to paste from the clipboard into the terminal.
Ctrl-Z to undo.
Ctrl-Shift-C (or even better, Super-C) to terminate the command.
Ctrl-Shift-Z (or Super-Z) to be the background command.
I*don't even know what Ctrl-V did before, some I*won't worry about remapping it.
How do I*make these changes? Thanks.
EDIT:*I*have no idea what is putting the * char after each "I". Maybe this is a non-breaking space??? (I gotta stop blindly experimenting and get some proper advice!)
Ctrl-C to copy the selected text to the clipboard. Ctrl-V to paste from the clipboard into the terminal. Cannot be done by bash except possibly within readline. Generic copy and paste are functions of the terminal emulator.
Ctrl-Z to undo. Undo what?
Ctrl-Shift-C (or even better, Super-C) to terminate the command. Ctrl-Shift-Z (or Super-Z) to be the background command. May be possible with stty, perhaps in conjunction with a custom termcap or terminfo file
Last edited by catkin; 07-06-2010 at 03:31 AM.
Reason: Prettification
First of all, bash isn't aware of the GUI and it's features, like Copy/Paste.
Second, X has a convenient Copy/Paste feature that only uses the mouse, no menus or shortcut keys. Just select some text to copy it, and click the middle button to paste it. No right-click menus or shortcut keys.
And finally, most terminal emulators use Ctrl+Shift+C and Ctrl+Shift+V to copy/paste, to avoid conflicts with bash.
I was waiting for a lecture about this. I anticipated your reasoning already and I decided I do indeed wish to proceed with my plan if there is a way to do it.
BTW, in Mac OS X, there is a nice solution for this. OS X uses the command key (super) instead of Ctrl. Copying is done via command-C. And this exact keystroke copies text in the terminal too. I got my first Mac a few months ago and I found the consistency for copy/paste to be so attractive and useful to me that I decided to try to achieve the same thing on Linux.
On the Mac I have remapped the command key to the capslock key. On Linux I remapped Ctrl to capslock. Switching back and forth doesn't give me the jolt it used it. This system actually suits me well.
If I can get bash to use ctrl-c to copy and ctrl-v to paste, it will be perfect. I'd be really surprised if there is absolutely not a way to do this in Linux.
bash is not aware of GUI features like Copy and Paste. The terminal emulator (xterm, Konsole, etc.) is!
I did read that. However, that doesn't mean I understood how to solve my problem based on that info.
The fact of the matter is that I don't care whether the solution is done at the level of the shell or at the level of the terminal emulator or even at a higher level (or some combination of those).
I read the other reply that said:
Quote:
May be possible with stty, perhaps in conjunction with a custom termcap or terminfo file.
in reference to a part of my request.
EDIT: and I don't even really care if bash ever sees the actual ctrl-C or the other remapped shortcuts. I just want ctrl-C to do a copy of the selected text. I'll remap the actual terminate command to any key combination.
EDIT: it seems to be working. I tested with a find command that would have taken a long time to finish and I was able to terminate it with ^K instead of ^C. The copy/paste commands definitely do work. I was already using those to copy the output of stty -a and paste here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.