You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
l command: the wrap width comes from the terminal size, and -l is ignored #551
The wrap width used by the l command does not come from the -l option or from its documented default. It comes from the width of the terminal the process happens to be running in, and falls back to 60 when there is no terminal. The same command on the same input therefore produces different bytes depending on where the output goes, and changes when the window is resized.
Tested with uutils sed 0.2.0 built from main at 77f442d, against GNU sed 4.9, under LC_ALL=C.
Measured under a pty of an explicit width, input 200 x, length of the first output line:
The GNU sed manual, on -l N: "A length of 0 (zero) means to never wrap long lines. If not specified, it is taken to be 70." On the l n argument: "a length of 0 (zero) means to never wrap long lines. If omitted, the default as specified on the command line is used."
compile_number_command in src/sed/compiler.rs stores output_width() when l has no numeric argument, and output_width() reads terminal_size(). The value from -l is already computed correctly into ProcessingContext::length in src/sed/mod.rs (defaulting to 70) and is never read.
Activity