Terminal insert A B C D on shift+arrows. Solution?
I'm new to Ubuntu and I don't know how I did it, but now when I try to select a text with Shift+[left/right]arrow keys, it inserts me "D C"(letters). I look up on Google for an hour and I haven't found anything really to help me.
I have installed Ubuntu with WUBI and I'm speaking about Ctrl+Alt+T terminal.
Solution 1:
I've found a workaround to copy text from gnome-terminal. It is via screen
. Credit goes to this answer
Type
screen
in the terminalPress Ctrl-A-[ to Enter the copy mode
Move your cursor to the desired start location.
Hit Enter to start copying.
Press and hold → or ← key to select text
Hit Enter again to stop copying.
Then move your cursor the the location you want to paste.
Press Ctrl-A-] to paste the text.
For a more complete screen tutorial, see this page.
Solution 2:
OK, here is some historical background. Terminal comes from times from before the ubiquity of the ctrlC and ctrlD shortcuts. In fact, ctrl-C has already had a meaning for a very long time: in a terminal, it is used to interrupt the current foreground process in a terminal. And Ctrl-D is for sending EOF (end of file).
See for your self; start a program that would take a lot of time and produce a lot of output, such as find /
, and press Ctrl-C to interrupt it. Start a program that expect some input, such as cat > testfile.txt
, type some text, and then press Enter (for newline) and Ctrl-D such that the program thinks "end of file, fine" and exits.
Moreover, copy and paste could (and can) be achieved in X in a much simpler way. The moment that you have selected any text with your mouse – just selected, no keys pressed – it has been copied to the X clipboard. Whenever you now press the right mouse button, without any keyboard shortcut, the text will get pasted. No need for shortcuts at all. This works not only in terminal, but also in other programs – try it!
However, you cannot use this method to copy anything other than simple text; to copy graphics, files etc. you need ctrl-c and ctrl-v.
Nonetheless, to achieve some compatibility with the modern dogma, you can use CtrlShiftC and CtrlShiftV in a terminal.