Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to provide long (1024/4096+ character) inputs to the OCaml toplevel #5678

Closed
vicuna opened this issue Jul 11, 2012 · 1 comment
Closed
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 11, 2012

Original bug ID: 5678
Reporter: antalsz
Assigned to: @diml
Status: closed (set by @xavierleroy on 2015-12-11T18:07:12Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)

Bug description

When using the OCaml toplevel, it will not accept more than 1024/4096 characters of input at a time. A line of input containing 1023/4095 characters can be followed by a return; a line of input containing 1024/4096 characters just beeps when any additional keys (letters, return, etc.) are pressed. Importantly, this only happens if OCaml is running interactively. Piping input in or reading input from a file does not cause any problems.

I've tested this on Mac OS X 10.6.7 and 10.7.4, with 3.12.1 from Homebrew (and 4.00.0+beta2 on the 10.6.7 system), I get this with 1024 characters every time. I believe the limit is 4096 characters on Linux systems, but I have not been able to check this directly (I have confirmed it second-hand).

Steps to reproduce

Generate a 1023/4095 character string, e.g. by running perl -e 'print ((" " x 1020) . "1;;")' or perl -e 'print ((" " x 4092) . "1;;")'; copy and paste this into the top level; and try to continue typing.

@vicuna
Copy link
Author

vicuna commented Jul 11, 2012

Comment author: @diml

This is not a limitation of OCaml but a limitation of the terminal. The standard toplevel does not implement line edition, so the buffered input of the terminal is used, and this one has a limited capacity. You can observe the same behavior with the command "cat" for example.

In order to write long lines in the toplevel you have to launch it with a program like ledit or rlwrap, or you can also use utop.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna assigned ghost Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant