[IPython-user] paste frustrations
Wed Mar 4 14:53:46 CST 2009
On 2009-03-04 07:38, Fernando Perez wrote:
> On Wed, Mar 4, 2009 at 5:35 AM, Robin<firstname.lastname@example.org> wrote:
>> I tried in both iTerm and Terminal.app - and just now in xterm and
>> they all exhibit the same.
>> In any case, I don't think it is the terminal, since in all of them I
>> can paste fine into python running on a Linux machine through an SSH
> Ah, OK.
>> It has to be something, but I've no idea what!
> Very frustrating... It does seem to be a problem with the actual
> input line buffer and/or readline. Sorry not to have any useful ideas
> or solutions...
Perhaps a solution would be to write a magic (with platform-specific backends)
that grabs the text for the clipboard and executes it without requiring user
intervention. It would be significantly more usable than %cpaste even if the
terminal or readline are working completely correctly.
The OS X backend is trivial; call out to pbpaste(1) using popen. xsel(1) appears
to be the thing for X. Windows would require either Mark Hammond's win32api or
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the IPython-user