Pound Hash
Pound Hash

Reputation: 553

How to draw a horizontal line across a terminal in zsh?

The aim is to to draw a line across a terminal using only zsh builtins.


Note that a similar question has been asked already about bash. This one is specific to zsh.

Upvotes: 0

Views: 397

Answers (1)

Pound Hash
Pound Hash

Reputation: 553

This code

print -- ${(l:COLUMNS::─:)}

Prints this line

──────────────────────────────────────────────────────────────

Note: The character (─) is a box drawing character, not a hyphen. Also, COLUMNS is a zsh parameter whose value is the width of the terminal. You could replace that with a specific width, e.g., 80.

Upvotes: 2

Related Questions