LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-03-2024, 11:06 AM   #1
bg368
Member
 
Registered: Nov 2006
Location: USA
Distribution: Debian
Posts: 43

Rep: Reputation: 12
copy and paste with middle mouse button


I have encountered this issue for years but I don't understand why.
If I highlight text in say "Firefox" and without clicking copy in the left button menu, sometimes I can just click the middle button in "terminal" and it gets pasted.
Other times I have to highlight the targeted text the copy it then go to the terminal and paste it through the left click menu.
If I highlight text and then click middle button (all within the same program) it seems to work fine, but when different programs are involved highlight then middle button click doesnt do it.
Any advice would be greatly appreciated.
Thanks
 
Old 03-03-2024, 01:03 PM   #2
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 795

Rep: Reputation: 255Reputation: 255Reputation: 255
There's actually 3 "copy/paste" under X window: Primary, Secondary, and Clipboard. What you are using then in your first example is Primary.

Code:
echo primary | xclip -sel p
echo secondary | xclip -sel s
echo clipboard | xclip -sel c

xclip -o -sel p
xclip -o -sel s
xclip -o -sel c
When you select Edit->Copy that's Clipboard. This https://blog.neil.brown.name/2021/07...window-system/ explains the background.
 
1 members found this post helpful.
Old 03-03-2024, 08:22 PM   #3
enigma9o7
Senior Member
 
Registered: Jul 2018
Location: Silicon Valley
Distribution: Bodhi Linux
Posts: 1,393

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
Paste what's highlighted with middle click is part of X11.
 
Old 03-04-2024, 01:39 PM   #4
bg368
Member
 
Registered: Nov 2006
Location: USA
Distribution: Debian
Posts: 43

Original Poster
Rep: Reputation: 12
Hey, thanks a lot guys. This gives me some new directions to look for the answers.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I disable middle mouse button click paste in Xorg/X11? patrick295767 Linux - Desktop 2 01-16-2017 02:55 PM
A keyboard shortcut to do the same thing as the middle mouse button paste powerpleb Linux - Newbie 1 06-17-2008 07:57 AM
Middle mouse button doesn't paste CJ Chitwood Linux - General 3 06-12-2008 10:32 PM
Disable copy-paste on middle mouse button 311Sam Ubuntu 6 10-09-2006 08:40 PM
middle mouse button is paste.. but what if i dont have a mid mouse button? kublador Linux - Newbie 4 09-02-2003 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration