rust-playground
rust-playground copied to clipboard
Carriage return (\r) doesn't work
I write the following in Rust playground:
fn main() {
let hej = "abc\rdef";
println!("{}", hej);
}
Actual output:
abcdef
Expected output:
def
The playground is not attempting to be a terminal emulator, so this behavior is expected. Likewise, if you output ANSI escape codes, those will not take effect either. The output of running cargo
is directly captured and shown in the output.
~~Is there an issue linking to an ANSI sort of mode?~~ (#879) xterm.js makes this very simple, and is used by projects such as genact (demo page with xterm).
~Is there an issue linking to an ANSI sort of mode?~ (#879) xterm.js makes this very simple, and is used by projects such as genact (demo page with xterm).
I'm not sure how this is related to the issue?
~Is there an issue linking to an ANSI sort of mode?~ (#879) xterm.js makes this very simple, and is used by projects such as genact (demo page with xterm).
I'm not sure how this is related to the issue?
I linked them because carriage return doesn't work along with a suite of other issues -- as the repository owner mentioned:
The playground is not attempting to be a terminal emulator, so this behavior is expected. Likewise, if you output ANSI escape codes, those will not take effect either.
I've created an issue to track whether an ANSI emulator (such as I've mentioned above, xterm.js) wants to be put inside the playground.