Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pasting in a screen session into ipython

When running ipython 5 and 6 in a gnu-screen session, pasting multiple lines does not work.

If I run ipython in a normal terminal session, I see the following when I paste 3 import lines separated by newlines:

In [1]: import datetime
   ...: import os
   ...: import glob
   ...:
   ...:

In [2]:

If I do the same into a gnu-screen session, I see:

In [1]: import datetime

In [2]:

i.e., the results are truncated at the first newline.

Is there any ipython or screen configuration item that can be used to work around this and achieve the same paste behavior in both terminals?

EDIT: This issue has apparently been reported somewhere on the ipython mailing list, as referenced on this issue.

like image 749
keflavich Avatar asked Nov 08 '22 09:11

keflavich


1 Answers

I ran into this problem as well with Gnu screen. The workaround I'm using is that I switched to Tmux. Tmux seems to have similar functionality to screen, and has a handy status bar that lists open virtual windows at the bottom. The default prefix key is CTRL-b.

More importantly for this question, pasting into an ipython terminal within a Tmux session works as expected for me.

like image 133
spinup Avatar answered Nov 27 '22 19:11

spinup