5

I regularly uses xterm for web browsing because of its image rendering property but the one thing which makes xterm difficult comparing to terminal is the copy/cut paste availability in terminal program. I have found this method and according to this i saved the below code in .Xdefaults file in home directory

xterm -ls -xrm 'XTerm*selectToClipboard: true'&

After the implementation of this code I am able to select text in xterm but not able to copy or cut paste (using mouse or keyboard shortcuts ctrl+c etc) any text from or to the xterm.

Any idea what went wrong?

4

You shall not include that line in .Xdefaults. Thus shalt thou start the program.

xterm -ls -xrm 'XTerm*selectToClipboard:true' &

Or with .Xdefaults:

Add this line:

XTerm*selectToClipboard:true

and reload the configuration

xrdb ~/.Xdefaults
  • It worked i am able to copy from xterm to a notepad but viseversa its not working. – Eka May 3 '15 at 17:41
  • 2
    @Eka Shift+Insert – A.B. May 3 '15 at 17:48
  • 1
    Better to use ~/.Xresources – Gayan Weerakutti May 8 '17 at 7:44
  • And don't overwrite everything from the previous configuration: xrdb -merge ~/.Xdefaults – finefoot Jun 18 '18 at 21:49
5

You can edit XTerm file, using vim or nano (I use vim):

vim /home/your_user_name/XTerm

Add this:

XTerm*Background: black
XTerm*Foreground: green
XTerm*SaveLines: 2000
XTerm*faceName: Ubuntu mono
XTerm*faceSize: 12
XTerm*rightScrollBar: true
XTerm*ScrollBar: true
XTerm*scrollTtyOutput: false
XTerm*VT100.Translations: #override \
      Shift Ctrl<Key>V: insert-selection(CLIPBOARD) \n\ 
      Shift Ctrl<Key>V: insert-selection(PRIMARY) \n\ 
      Shift<Btn1Down>: select-start() \n\ 
      Shift<Btn1Motion>: select-extend() \n\ 
      Shift<Btn1Up>: select-end(CLIPBOARD) \n\

Save and close whit:

:wq

Open xterm:

xterm &

This configuration allows:

  1. Select and copy text into xterm: Hold Shiht key, click left mouse, select your text and click right mouse, to add it to clipboard.
  2. Paste text into xterm: Press Ctrl+Shift+V
  3. Show ScrollBar.
  4. Personalize font.

I hope this help you.

  • 1
    How would you do Ctrl + Shift + c for interrput? – William Jan 21 '17 at 17:02
  • You must stop pressing the left mouse button and the Shiht key. – SIMON CEDENO7 Feb 20 '17 at 8:59
  • @SIMONCEDENO7 I think the last \n\ is not necessary and might even be a problem if you want to add more lines with settings after it. – finefoot Jun 18 '18 at 20:32
  • @Jayjayyy You are right! Then you can ignore it. Thanks – SIMON CEDENO7 Jun 18 '18 at 21:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.