Files
Guennadi Maximov C bf0747f4af docs: fixed many small issues in Lua docs pages (#7124)
* lua: fixed markdown lists not rendering correctly in webpage
* unicode_version: fixed typo in markdown file
* visual_bell: fixed typo in documentation
* load_base16_scheme: added comma for redaction, etc.
* truncate_right: corrected improper punctuation
* mux: improved Lua snippet in `rename_workspace`
* wezterm.color.save_scheme: improved docs
* wezterm.plugin: improved every function's docs
* visual_bell: added missing code enclosures

---------

Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
2026-11-20 04:31:22 +01:00

20 lines
516 B
Markdown

---
title: wezterm.truncate_right
tags:
- utility
- string
---
# wezterm.truncate_right(string, max_width)
{{since('20210502-130208-bff6815d')}}
Returns a copy of `string` that is no longer than `max_width` columns
(as measured by [wezterm.column_width](column_width.md)).
Truncation occurs by reemoving excess characters from the right end
of the string.
For example, `wezterm.truncate_right("hello", 3)` returns `"hel"`.
See also: [wezterm.truncate_left](truncate_left.md), [wezterm.pad_left](pad_left.md).