pub enum LineEnding {
Lf,
CrLf,
Cr,
}Expand description
Line ending styles.
Variants§
Lf
Unix-style line ending (LF).
CrLf
Windows-style line ending (CRLF).
Cr
Classic Mac line ending (CR).
Implementations§
Trait Implementations§
Source§impl Clone for LineEnding
impl Clone for LineEnding
Source§fn clone(&self) -> LineEnding
fn clone(&self) -> LineEnding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LineEnding
Source§impl Debug for LineEnding
impl Debug for LineEnding
Source§impl Default for LineEnding
The default is whatever the platform’s terminal actually sends for ENTER, which
is not the same as the platform’s text-file convention.
impl Default for LineEnding
The default is whatever the platform’s terminal actually sends for ENTER, which is not the same as the platform’s text-file convention.
On Windows this is LineEnding::Cr, not CrLf. ConPTY discards a bare LF
entirely — measured on Windows 11 26200.8893, a lone \n completes no line
read, queues nothing, and is not even echoed — so an LF default makes
send_line unable to submit a line at all. \r is
the byte a terminal sends for the Enter key.
CrLf also works today, but only because conhost happens to swallow the
trailing LF; that is undocumented, and against a child with ENABLE_LINE_INPUT
disabled an LF that did arrive would submit a second Enter. Cr cannot
double-submit on any build.