Crates.io | printrn |
lib.rs | printrn |
version | 0.1.5 |
source | src |
created_at | 2023-01-10 22:07:57.444624 |
updated_at | 2023-01-11 02:39:24.125328 |
description | A macro to replace `println!()`, that will replace all `\n` with `\r\n`, e.g. for crossterm or other raw terminal work. |
homepage | |
repository | |
max_upload_size | |
id | 755876 |
size | 12,819 |
A macro to replace println!()
, that will replace all \n
with \r\n
.
This is useful when working with raw terminals, such as via crossterm
or tui
. In raw terminal mode, \n
will only move the current line one down, and keep printing from there, like so:
APPLE
BOOK
CHERRY
Which is where \r
(short for carriage Return) comes in. By replacing all \n
with \r\n
, you can get the more expected behavior:
APPLE
BOOK
CHERRY