Skip to content
This repository has been archived by the owner on Aug 5, 2023. It is now read-only.

Long code support #7

Open
Jeff-HOU opened this issue Apr 9, 2018 · 1 comment
Open

Long code support #7

Jeff-HOU opened this issue Apr 9, 2018 · 1 comment

Comments

@Jeff-HOU
Copy link

Jeff-HOU commented Apr 9, 2018

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

@gusutabopb
Copy link
Owner

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 gusutabopb changed the title long code support Long code support Apr 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants