[BUG] panic when piping another ion echo into echo
Running ion -c "echo test" | echo
panics at src/lib/builtins/echo.rs:156
when flushing the locked stdout in the BufWriter:
thread 'main' panicked at 'already borrowed: BorrowMutError', src/libcore/result.rs:1084:5
stack backtrace:
0: std::panicking::default_hook::{{closure}}
1: std::panicking::rust_panic_with_hook
2: std::panicking::continue_panic_fmt
3: rust_begin_unwind
4: core::panicking::panic_fmt
5: core::result::unwrap_failed
6: <std::io::stdio::Stdout as std::io::Write>::flush
7: ion_shell::shell::Shell::install_signal_handler::sigpipe_handler
8: _sigtramp
[2] 59222 abort ( ion -c "echo test"; )
ion -c "echo test" | gecho
(where gecho is GNU's coreutils echo) breaks as well, while
ion -c "gecho test" | echo
works fine.
(ion -c "echo test" | cat
is fine too)