sxyazi/yazi · error

offset height must be at least 3: {:?}

Error message

offset height must be at least 3: {:?}

What it means

Validation in `TryFrom<[i16; 4]> for Offset`: the height (`values[3]`) is below 3. The layout code assumes a minimum pane height of 3 rows (e.g. borders plus a content line), so shorter offsets are rejected to avoid degenerate layouts.

Source

Thrown at yazi-binding/src/position/offset.rs:35

			y:      value.y as i16,
			width:  value.width,
			height: value.height,
		}
	}
}

impl TryFrom<[i16; 4]> for Offset {
	type Error = anyhow::Error;

	fn try_from(values: [i16; 4]) -> Result<Self, Self::Error> {
		if values.len() != 4 {
			bail!("offset must have 4 values: {:?}", values);
		}
		if values[2] < 0 || values[3] < 0 {
			bail!("offset width and height must be positive: {:?}", values);
		}
		if values[3] < 3 {
			bail!("offset height must be at least 3: {:?}", values);
		}

		Ok(Self {
			x:      values[0],
			y:      values[1],
			width:  values[2] as u16,
			height: values[3] as u16,
		})
	}
}

View on GitHub (pinned to 5f901b886b)

Solutions

  1. Set the offset height to at least 3.
  2. Re-check the computed preview rect if it derives from a very small terminal or pane.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at yazi-binding/src/position/offset.rs:35 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sxyazi/yazi@5f901b886b (2026-09-02). Data as JSON: /api/errors/f134030d521c80de. Report an issue: GitHub.