diff --git a/CHANGELOG.md b/CHANGELOG.md index da6de45f8..9ff27e18d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/sphinx_doc_src/cmds/read.rst b/sphinx_doc_src/cmds/read.rst index d4f77b94d..f1edeaf2d 100644 --- a/sphinx_doc_src/cmds/read.rst +++ b/sphinx_doc_src/cmds/read.rst @@ -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. diff --git a/sphinx_doc_src/index.rst b/sphinx_doc_src/index.rst index a68edaa78..b33f3846b 100644 --- a/sphinx_doc_src/index.rst +++ b/sphinx_doc_src/index.rst @@ -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:: diff --git a/src/env_dispatch.cpp b/src/env_dispatch.cpp index c472ae2ad..aba29700e 100644 --- a/src/env_dispatch.cpp +++ b/src/env_dispatch.cpp @@ -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;