Kurukuru icon indicating copy to clipboard operation
Kurukuru copied to clipboard

Kurukuru display invalid output when using pipe

Open wk-j opened this issue 8 years ago • 2 comments

 class Program
    {
        static void Spin(string line)
        {
            Spinner.Start(line, spinner =>
            {
                spinner.Text = "Stage 2... ";
                Thread.Sleep(200);
                spinner.Fail("Something went wrong!");
            });
        }
        static void Main(string[] args)
        {
            string line;
            while ((line = Console.ReadLine()) != null)
            {
                Spin(line);
            }
        }
}

Pipe input

echo hello | mono src/KurukuruPipe/bin/Debug/net47/KurukuruPipe.exe

Result

⠋ Stage 2... ⠙ Stage 2... ⠹ Stage 2... ✖ Something went wrong!

wk-j avatar Dec 17 '17 16:12 wk-j

Hi, I tried to reproduce on Linux (Ubuntu 16.04) and Mono 5.4.1.6. But I couldn't reproduce it. What versions of Mono and OS are you running?

$ mono -V | head -1
Mono JIT compiler version 5.4.1.6 (tarball Wed Nov  8 20:37:08 UTC 2017)

$ cat /etc/os-release | head -2
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"

$ mono ConsoleApp1.exe | more
Hello World!
✔ Hoge

mayuki avatar Dec 18 '17 05:12 mayuki

I'm using mono 5.4.1.6 on Mac OS. It occur if using input pipe like below

❯ mono /Users/wk/Source/github/KurukuruPipe/src/KurukuruPipe/bin/Debug/net47/KurukuruPIpe.exe | more
✖ Something went wrong!

❯ echo hello | mono /Users/wk/Source/github/KurukuruPipe/src/KurukuruPipe/bin/Debug/net47/KurukuruPIpe.exe
⠋ Stage 2... ⠙ Stage 2... ⠹ Stage 2... ✖ Something went wrong!

❯ mono -V
Mono JIT compiler version 5.4.1.6 (tarball Mon Dec 11 14:59:42 GMT 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug
	LLVM:          supported, not enabled.
	GC:            sgen (concurrent by default)

wk-j avatar Dec 18 '17 05:12 wk-j