STRING-PAD(1)
π NAME π
okay so bestie, welcome to STRING-PAD(1) from the fish-shell manual β¨ string-pad is the little icon that pads strings to a fixed width, no cap. Itβs giving βmake my output line upβ and honestly? slay. π
β¨ SYNOPSIS β¨
Hereβs the whole vibe in one look, keep it close:
string pad [-r | --right] [-C | --center] [(-c | --char) CHAR] [(-w | --width) INTEGER]
[STRING ...]
π¦ DESCRIPTION π¦
string pad takes each STRING and extends it to the given visible width by adding CHAR to the left. Thatβs the main character move π
. βVisible widthβ means the width of all visible characters added together, excluding escape sequences and accounting for fish_emoji_width and fish_ambiguous_width. Itβs literally the amount of columns in a terminal that the STRING occupies.
The escape sequences reflect what fish knows about, and how it computes its output. Your terminal might support more escapes, or not support escape sequences that fish knows about. So like, your terminal can have extra tricks or be missing some of fishβs tricks β thatβs just the situation, bestie π«Ά.
If -C or --center is given, add the padding to before and after the string. If itβs impossible to perfectly center the result β because the required amount of padding is an odd number β extra padding will be added to the left, unless --right is also given. Center girlies, take notes π.
If -r or --right is given, add the padding after a string. If -c or --char is given, pad with CHAR instead of whitespace. The output is padded to the maximum width of all input strings. If -w or --width is given, use at least that. Lowkey iconic how -w sets a minimum vibe π.
π EXAMPLES π
Look at that alignment π:
>_ string pad -w 10 abc abcdef
abc
abcdef
Emoji padding? Obsessed π:
>_ string pad --right --char=π "fish are pretty" "rich. "
fish are pretty
rich. ππππ
And this one is very $COLUMNS cuntiness β¨:
>_ string pad -w$COLUMNS (date)
# Prints the current time on the right edge of the screen.
π SEE ALSO π
- The
printfcommand can do simple padding, for exampleprintf %10s\nworks likestring pad -w10. π«Ά string lengthwith the--visibleoption can be used to show what fish thinks the width is. π
π Copyright π
Β© fish-shell developers
mwah π β thatβs the whole STRING-PAD(1) moment, brought to you by fish-shell, version 4.9, dated Sep 08, 2026. byeee bestie π«Άβ¨
π¦ where this page comes from
- arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms