Skip to main content

MAX_RUN_SCRIPT_BYTES

Constant MAX_RUN_SCRIPT_BYTES 

Source
pub const MAX_RUN_SCRIPT_BYTES: u64 = 1_048_576;
Expand description

Maximum size of a script file the run command will load for parsing.

run is a parser keyword: interactive re-parse (syntax highlight, completion, validation) reloads the argument path on every keystroke / Tab. Without a bound, a large path is fully loaded and force-fed through the Nu parser, which can hang the REPL and use multi‑GiB of RAM.

1 MiB is large enough for typical scripts while keeping interactive parse responsive.

This limit is intentionally only applied to run, not source / modules.