LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 11-19-2009, 11:41 AM   #16
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405

Amazing, this little application has become my new friend, it can even run without that silly tray icon, for those that don't have and don't need a system tray.

Thanks for sharing.
 
Old 07-17-2011, 05:25 AM   #17
vpa2013
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
still not what i'm looking for

Hello,
Being a putty user I had the same issue. I'm on Ubuntu and Parcellite doesn't solve the problem for me, because it will overwrite the clipboard with anything I select (in editor, in adress bar in firefox, etc...) when I want this function to apply only for the terminal.
I don't say that the behavior of gnome is less good than the behavior of putty; i suppose i may come handy to have two clipboards when you're use to it, it's just that I can't get used to it because I keep working on putty in the same time in my job.

If I activate the parcellite unifier, i cannot do this kind of actions anymore:
- select an url from the editor and put it in firefox adress bar: because when I select the previous adress in firefox to delete it, it will overwrite the address i wanted to paste from the clipboard
- replace a block of text by another in an editor: whenever I select the text for deletion, it will overwrite the text that I wanted to paste and that I had put in the clipboard beforehand...

So eventually i'd rather deactivate parcellite. I use the middle button to paste from terminal but from time to time I would do another selection in between (again typically that would be some text that I want to overwrite with the selection from the terminal) and I would loose what I wanted to paste grrrr... or else you need to use the Ctrl+maj+C everytime to copy from terminal which is quite an annoying combination when you're used to doing nothing...


Anyone knows a way to have this "copy to main clipboard on select in terminal" feature working but only for the terminal and not for all the selections to avoid the overwrite scenario issues, it would be great to share because this keeps bugging me every day!
I'm ready to use another terminal application if that does it.


Thanks

Last edited by vpa2013; 07-17-2011 at 05:42 AM.
 
Old 07-17-2011, 08:44 AM   #18
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
Originally Posted by vpa2013 View Post
Anyone knows a way to have this "copy to main clipboard on select in terminal" feature working but only for the terminal and not for all the selections to avoid the overwrite scenario issues, it would be great to share because this keeps bugging me every day!
The selection-copy mechanism is a function built into the x-server, not the programs. And it's not even a "buffer" as such, but a data transfer. When you middle-click, the x-server directly copies the currently (or most recently) highlighted text data from the source process into the target process. That's why you can't paste data after closing a window, by the way, as there's no buffer to store the text in. When the program vanishes, so does the selection.

The separate "clipboard" was designed to be a less ephemeral alternative with a real, live buffer. You use it when you need to store the text temporarily while you do something else. The clipboard is there to do exactly the kind of thing you're asking for.

And yes, terminal applications can be a hassle when it comes to the clipboard cut+paste, due to the pre-existing definition of ctrl+c as SIGINT that likely pre-dates the modern gui. But most console applications do define alternative shortcuts for it. Konsole, for example, predefines shift+insert for pasting from clipboard, and ctrl+shift+insert for pasting from selection. Check the keybindings of the program you're using.

It's also possible to use stty to re-define the key combo that sends the SIGINT signal to the terminal. I've never tried doing it myself though, so look it up.

I suggest though that what you really need to do is readjust your thinking to adapt to the x-windows paradigm. Having two separate features that work slightly differently is actually more convenient, IMO, than trying to unify them with a synchronizing tool. So learn to prepare the target area before you select. Fall back to using the clipboard when that isn't possible, and be aware that different programs may have different ways to call the paste function.

For Firefox, use extensions like xclear, or one of several others that provide toolbar buttons for clearing fields. Some other programs like konqueror also provide clear-field buttons precisely for this purpose.

Another thing you can do is set up a couple of simple scripts (using xsel or xclip) to manually transfer text between the selection and the clipboard. Add a couple of toolbar launchers/shortcuts/mouse gestures/whatever to execute them, and you have a quick way to save selected text to the clipboard, then back again to the selection for pasting.
Code:
#!/bin/bash
# seltoclip -- copy the current highlighted
# selection to the clipboard.

xsel -o | xsel -i -b
Code:
#!/bin/bash
# cliptosel -- copy the current
# clipboard text to the x-selection.

xsel -o -b | xsel -i

Last edited by David the H.; 07-17-2011 at 08:49 AM. Reason: a cuple o typos
 
Old 07-17-2011, 09:35 AM   #19
vpa2013
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
Automation

@David
>> xsel -o | xsel -i -b

That does what i want indeed but is there a way to trigger this command from text selection in the terminal?
Associating a different keyboard shortcut than Ctrl+shift+C can already be done from the terminal configuration
I suppose there are ways like you say to trigger the command with a mouse action (like keep the button down longer) but is there a way to truly automatize this for every selection in the terminal with no added mouse/keyboard action?
 
Old 07-17-2011, 10:15 AM   #20
vpa2013
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
new paradigm?

I would be ready to adopt the linux "double clipboard" paradigm, although today is sunday and it was really not in my plans, but looking at putty options, it doesn't seem to be able to mimic the separate selection/main clipboard mechanism; and maintaining two different paradigms for copy-paste is really too much of a hassle
 
Old 07-17-2011, 12:50 PM   #21
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by vpa2013 View Post
@David
>> xsel -o | xsel -i -b

That does what i want indeed but is there a way to trigger this command from text selection in the terminal?
Associating a different keyboard shortcut than Ctrl+shift+C can already be done from the terminal configuration
I suppose there are ways like you say to trigger the command with a mouse action (like keep the button down longer) but is there a way to truly automatize this for every selection in the terminal with no added mouse/keyboard action?
Unless you want to hack the terminal emulator code for this, or unless it does already provide a way to do this, the easier way to do this is a global key binding in your window manager, whatever it is.
 
  


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
Is there terminal program that supports copy&paste with keyboard (read for specifics) robsku Linux - Desktop 1 08-18-2009 02:11 AM
rsync syntax to skip directory, but copy select files.. tnicol Linux - Software 3 07-24-2007 05:40 AM
Copy select files with command line Storyman Linux - Newbie 5 01-23-2007 03:35 AM
Why I can't copy or select text from XCHM ? Bonch Debian 1 12-22-2004 04:38 AM
select, copy and paste lusko Slackware 2 11-12-2002 03:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:57 AM.

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