Increase default read limit to 100MiB

Someone has hit the 10MiB limit (and of course it's the number of
javascript packages), and we don't handle it fantastically currently.

And even though you can't pass a variable of that size in one go, it's
plausible that someone might do it in multiple passes.

See #5267.
This commit is contained in:
Fabian Homborg 2019-05-29 11:01:45 +02:00
parent d0921489ee
commit 97507a24a2
4 changed files with 5 additions and 4 deletions

View file

@ -32,6 +32,7 @@
- `argparse` learned a new `--ignore-unknown` flag to keep unrecognized options, allowing multiple argparse passes to parse options (#5367).
- `fish_indent` now handles semicolons better, including leaving them in place for `; and` and `; or` instead of breaking the line.
- `test` (aka `[`) now prints a stacktrace on error, making the offending call easier to find (#5771).
- The default read limit has been increased to 100MiB (#5267).
### Interactive improvements
- Major improvements in performance and functionality to the 'sorin' sample prompt (#5411).

View file

@ -70,7 +70,7 @@ When ``read`` reaches the end-of-file (EOF) instead of the terminator, the exit
Otherwise, it is set to 0.
In order to protect the shell from consuming too many system resources, ``read`` will only consume a
maximum of 10 MiB (1048576 bytes); if the terminator is not reached before this limit then VARIABLE
maximum of 100 MiB (104857600 bytes); if the terminator is not reached before this limit then VARIABLE
is set to empty and the exit status is set to 122. This limit can be altered with the
``fish_read_limit`` variable. If set to 0 (zero), the limit is removed.

View file

@ -745,7 +745,7 @@ The exit status of the last run command substitution is available in the `status
Only part of the output can be used, see `index range expansion <#expand-index-range>`_ for details.
Fish has a default limit of 10 MiB on the amount of data a command substitution can output. If the limit is exceeded the entire command, not just the substitution, is failed and ``$status`` is set to 122. You can modify the limit by setting the ``fish_read_limit`` variable at any time including in the environment before fish starts running. If you set it to zero then no limit is imposed. This is a safety mechanism to keep the shell from consuming too much memory if a command outputs an unreasonable amount of data. Note that this limit also affects how much data the ``read`` command will process.
Fish has a default limit of 100 MiB on the amount of data a command substitution can output. If the limit is exceeded the entire command, not just the substitution, is failed and ``$status`` is set to 122. You can modify the limit by setting the ``fish_read_limit`` variable at any time including in the environment before fish starts running. If you set it to zero then no limit is imposed. This is a safety mechanism to keep the shell from consuming too much memory if a command outputs an unreasonable amount of data, typically your operating system also has a limit, and it's often much lower. Note that this limit also affects how much data the ``read`` command will process.
Examples::

View file

@ -531,6 +531,6 @@ bool term_supports_setting_title() { return can_set_term_title; }
/// Miscellaneous variables.
bool g_use_posix_spawn = false;
// Limit `read` to 10 MiB (bytes not wide chars) by default. This can be overridden by the
// Limit `read` to 100 MiB (bytes not wide chars) by default. This can be overridden by the
// fish_read_limit variable.
size_t read_byte_limit = 10 * 1024 * 1024;
size_t read_byte_limit = 100 * 1024 * 1024;