Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank lines emitted while spinning inside an Alpine Linux container #6

Open
atifaziz opened this issue Aug 26, 2020 · 3 comments
Open
Labels

Comments

@atifaziz
Copy link

When a program is run inside an Alpine Linux container (the case I tested), the spinner emit blank lines and causes scrolling.

Steps to Reproduce

Example program:

using System;
using System.Threading;
using Kurukuru;

static class Program
{
    static void Main() =>
        Spinner.Start("Processing...", () => Thread.Sleep(1000 * 3));
}

Run the .NET Core 3.1 SDK image on Alpine Linux:

docker run --rm -it mcr.microsoft.com/dotnet/core/sdk:3.1-alpine

Once on the shell prompt inside the container image, copy and paste the following:

mkdir Demo
cd Demo
dotnet new console
dotnet add package Kurukuru
cat > Program.cs << EOF
using System;
using System.Threading;
using Kurukuru;

static class Program
{
    static void Main() =>
        Spinner.Start("Processing...", () => Thread.Sleep(1000 * 3));
}
EOF
dotnet run

When dotnet run executes the program, you should notice blank lines being emitted during spinning and possibly scrolling.

Here is what my session looked like:

❯ docker run --rm -it mcr.microsoft.com/dotnet/core/sdk:3.1-alpine
/ # mkdir Demo
/ # cd Demo
/Demo # dotnet new console
Getting ready...
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /Demo/Demo.csproj...
  Restore completed in 219.52 ms for /Demo/Demo.csproj.

Restore succeeded.

/Demo # dotnet add package Kurukuru
  Writing /tmp/tmpnKJEhm.tmp
info : Adding PackageReference for package 'Kurukuru' into project '/Demo/Demo.csproj'.
info : Restoring packages for /Demo/Demo.csproj...
info :   GET https://api.nuget.org/v3-flatcontainer/kurukuru/index.json
info :   OK https://api.nuget.org/v3-flatcontainer/kurukuru/index.json 458ms
info :   GET https://api.nuget.org/v3-flatcontainer/kurukuru/1.1.0/kurukuru.1.1.0.nupkg
info :   OK https://api.nuget.org/v3-flatcontainer/kurukuru/1.1.0/kurukuru.1.1.0.nupkg 18ms
info : Installing Kurukuru 1.1.0.
info : Package 'Kurukuru' is compatible with all the specified frameworks in project '/Demo/Demo.csproj'.
info : PackageReference for package 'Kurukuru' version '1.1.0' added to file '/Demo/Demo.csproj'.
info : Committing restore...
info : Writing assets file to disk. Path: /Demo/obj/project.assets.json
log  : Restore completed in 1.38 sec for /Demo/Demo.csproj.
/Demo # cat > Program.cs << EOF
> using System;
> using System.Threading;
> using Kurukuru;
>
> static class Program
> {
>     static void Main() =>
>         Spinner.Start("Processing...", () => Thread.Sleep(1000));
> }
> EOF
/Demo # dotnet run













✔ Processing...

Notice blank lines between dotnet run and the final ✔ Processing....

@atifaziz
Copy link
Author

FYI, the same issue occurs when the same steps are run in a WSL distribution like Ubuntu 16.04.

If you don't have .NET Core SDK setup in your Ubuntu on WSL, you can do so by running the following commands on the BASH shell:

wget -q https://dot.net/v1/dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --version 3.1.401
export PATH="$PATH:$HOME/.dotnet"

Then proceed with the same steps as shown in my original comment to create and run a demo application:

mkdir Demo
cd Demo
dotnet new console
dotnet add package Kurukuru
cat > Program.cs << EOF
using System;
using System.Threading;
using Kurukuru;

static class Program
{
    static void Main() =>
        Spinner.Start("Processing...", () => Thread.Sleep(1000 * 3));
}
EOF
dotnet run

@atifaziz
Copy link
Author

Below is a recording of an Ubuntu (on WSL) session depicting the steps above and the issue, and which you can playback by just clicking the image.

asciicast

@bnygld
Copy link

bnygld commented Dec 11, 2020

Having the same behaviour on OSX 10.15.7 + dotnet 5.0.0

@mayuki mayuki added the bug label Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants