randy3k / SendCode

Send code and text to macOS and Linux Terminals, iTerm, ConEmu, Cmder, Tmux, Terminus; R (RStudio), Julia, IPython.
MIT License
204 stars 28 forks source link

Error sending large chunks of code. #101

Closed chadbot closed 6 years ago

chadbot commented 6 years ago

Hi there,

When sending a large chunk of code to iPython in Terminus, it looks like SendCode is prematurely inserting the "close bracket" characters. For instance, this works fine:

for i in range(1, 10):
    # some stuff to ignore
    print(i)

However, this code would result in an error:

for i in range(1, 10):
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    # some stuff to ignore
    print(i)

For what it's worth, SendCode appears to be inserting a ^[ toward the end of the sent code, which is what's causing the problem.

Thanks as always for all your awesome work, and let me know if you need any other info.

randy3k commented 6 years ago

What version of IPython is it?

chadbot commented 6 years ago

IPython v6.5.0 and Python 3.7.0 on MacOS.

chadbot commented 6 years ago

Issue may be specific to Terminus. I just tested in iTerm and the above code executes fine there.

randy3k commented 6 years ago

I can reproduce it, it is a regression of fixing https://github.com/randy3k/Terminus/issues/41

randy3k commented 6 years ago

It is a bug of Terminus, let's move it to Terminus.

randy3k commented 6 years ago

The terminus bug should be fixed by https://github.com/randy3k/Terminus/commit/a062c2e3c343b65b06829835f597cae6e20d01fe

chadbot commented 6 years ago

Works great. Thanks!