Pasting external text into XTerm or UXTerm

9,554

Solution 1

Pasting external text into a terminal window the Linux way

The Linux way works with xterm and uxterm, where there are no drop-down menus or Windows style control codes like ctrl + shift + v.

  1. Mark the text in the web page by pressing the left button of the mouse and move the mouse.

  2. After that move the mouse so that the cursor is in the terminal window.

  3. Press the middle button or the scroll wheel (press the scroll wheel as if it were a middle button). If there is no middle button you can press both the left and right buttons at the same time.

Solution 2

From the very helpful XTerm introduction and TrueType fonts configuration (futurile.net):

  1. Put configuration into ~/.Xresources
  2. Merge in changes to a running X session with: $ xrdb -merge ~/.Xresources

~snip~

To tell xterm to use the standard Ctrl+Shift+c and Ctrl+Shift+v in the same way as gnome-terminal you add:

xterm*VT100.Translations: #override \ Shift <KeyPress> Insert: insert-selection(CLIPBOARD) \n\ Ctrl Shift <Key>V: insert-selection(CLIPBOARD) \n\ Ctrl Shift <Key>C: copy-selection(CLIPBOARD) \n\ Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY)

This line works for uxterm; simply duplicate it and insert a u at the beginning.

Share:
9,554

Related videos on Youtube

RangerX
Author by

RangerX

Updated on September 18, 2022

Comments

  • RangerX
    RangerX over 1 year

    I have a newly installed Ubuntu 17.04 Server and am trying to install some packages that require long command lines.

    I want to copy the long command line from the web page and paste it into the terminal window. However, NONE of the standard key or mouse combinations will work, i.e. ctrl+shift+v, shift+insert, ctrl+insert, middle click. Nothing works.

    How can I paste external text into XTerm or UXTerm?

    • luv.preet
      luv.preet over 6 years
      are you using a VM ?