imongo icon indicating copy to clipboard operation
imongo copied to clipboard

Long code support

Open Jeff-HOU opened this issue 7 years ago • 1 comments

Hi Gustavo,

Thanks for your imongo. It is very useful! However, I always get the following message:

Code too long. Please commands with less than 1024 effective chracters. Indentation spaces/tabs don't count towards "effective" characters. Restarting mongo shell...

I wonder if this is due to that long code is not supported by imongo and how to deal with it?

Thanks for your help and best! Jeff

Jeff-HOU avatar Apr 09 '18 07:04 Jeff-HOU

Thanks for raising the issue. I have been aware of this but I don't have time to work on it now. However, PRs are welcome! Some more info from the source code comments:

TODO: Enable sending lines long lines (>1024 on macOS >4096 on Linux).
This is related to a buffering issue and seems that can only be solved
by splitting lines, and waiting for the continuation prompt.
However this MAY interfere with how responses are currently received
Ref: http://pexpect.readthedocs.io/en/stable/_modules/pexpect/pty_spawn.html#spawn.send

If you are on Linux, a quick hack would be to change the hard-coded 1024 value to 4096. If you make it larger you likely get some weird errors.

gusutabopb avatar Apr 29 '18 02:04 gusutabopb