dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.71k stars 1.06k forks source link

Text input from keyboard to terminal bash prompt gets hidden after running `dotnet test` #4273

Open x10an14 opened 4 years ago

x10an14 commented 4 years ago

Steps to reproduce

  1. git clone git@github.com:x10an14/RazorLight.git
  2. cd RazorLight
  3. git checkout f7ada2f3ab166893248af42aca81f0e865bca621
  4. dotnet test
  5. See if you can see the terminal/prompt react visually to any of your keyboard inputs (aka you typing your next command)1.

1: It does react (for me at least) under the hood, but it never shows anything.

Excerpt of me running the command twice, but second time without seeing it appear when entered into terminal session. ```bash [2019-11-28 22:43:10] 0 x10an14@x10-desktop:~/github/razorlight (permit_relative_paths $=) -> $ dotnet test TagHelpers/DefaultTagHelperFactory.cs(16,71): warning CS0649: Field 'DefaultTagHelperFactory._getPropertiesToActivate' is never assigned to, and will always have its default value null [/home/x10an14/Documents/github/razorlight/src/RazorLight/RazorLight.csproj] PrecompileRunCommand.cs(22,41): warning CS0169: The field 'PrecompileRunCommand.factoryProvider' is never used [/home/x10an14/Documents/github/razorlight/src/RazorLight.Precompile/RazorLight.Precompile.csproj] PrecompileRunCommand.cs(23,42): warning CS0649: Field 'PrecompileRunCommand.compiler' is never assigned to, and will always have its default value null [/home/x10an14/Documents/github/razorlight/src/RazorLight.Precompile/RazorLight.Precompile.csproj] Generation/RazorSourceGeneratorTest.cs(17,17): warning CS0618: 'RazorEngine.Create()' is obsolete: 'This method is obsolete and will be removed in a future version.' [/home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/RazorLight.Tests.csproj] Generation/RazorSourceGeneratorTest.cs(44,17): warning CS0618: 'RazorEngine.Create()' is obsolete: 'This method is obsolete and will be removed in a future version.' [/home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/RazorLight.Tests.csproj] Generation/RazorSourceGeneratorTest.cs(55,16): warning CS0618: 'RazorEngine.Create()' is obsolete: 'This method is obsolete and will be removed in a future version.' [/home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/RazorLight.Tests.csproj] Generation/RazorSourceGeneratorTest.cs(78,54): warning CS0618: 'RazorEngine.Create()' is obsolete: 'This method is obsolete and will be removed in a future version.' [/home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/RazorLight.Tests.csproj] Generation/RazorSourceGeneratorTest.cs(96,54): warning CS0618: 'RazorEngine.Create()' is obsolete: 'This method is obsolete and will be removed in a future version.' [/home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/RazorLight.Tests.csproj] Generation/RazorSourceGeneratorTest.cs(111,54): warning CS0618: 'RazorEngine.Create()' is obsolete: 'This method is obsolete and will be removed in a future version.' [/home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/RazorLight.Tests.csproj] Test run for /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp2.0/RazorLight.Tests.dll(.NETCoreApp,Version=v2.0) Microsoft (R) Test Execution Command Line Tool Version 16.3.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. True [xUnit.net 00:00:00.9739004] RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [FAIL] X RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [69ms] Error Message: RazorLight.TemplateNotFoundException : Project can not find template with key /home//x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp2.0/template1.cshtml Stack Trace: at RazorLight.Compilation.RazorTemplateCompiler.CreateRuntimeCompilationWorkItem(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 189 at RazorLight.Compilation.RazorTemplateCompiler.OnCacheMissAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 114 at RazorLight.Compilation.RazorTemplateCompiler.CompileAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 84 at RazorLight.EngineHandler.CompileTemplateAsync(String key) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 51 at RazorLight.EngineHandler.CompileRenderAsync[T](String key, T model, ExpandoObject viewBag) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 131 at RazorLight.Tests.Integrational.RaceConditionTests.<>c__DisplayClass0_0.<b__0>d.MoveNext() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 26 --- End of stack trace from previous location where exception was thrown --- at RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 29 --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:00:02.9203224] RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [FAIL] X RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [1ms] Error Message: Assert.Equal() Failure ↓ (pos 1) Expected: /key Actual: /home//x10an14/Documents/github/razorlight··· ↑ (pos 1) Stack Trace: at RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Compilation/RazorTemplateCompilerTest.cs:line 60 Test Run Failed. Total tests: 135 Passed: 133 Failed: 2 Total time: 3.8015 Seconds Test run for /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp3.0/RazorLight.Tests.dll(.NETCoreApp,Version=v3.0) Microsoft (R) Test Execution Command Line Tool Version 16.3.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. True [xUnit.net 00:00:00.8697064] RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [FAIL] X RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [59ms] Error Message: RazorLight.TemplateNotFoundException : Project can not find template with key /home//x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp3.0/template1.cshtml Stack Trace: at RazorLight.Compilation.RazorTemplateCompiler.CreateRuntimeCompilationWorkItem(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 189 at RazorLight.Compilation.RazorTemplateCompiler.OnCacheMissAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 114 at RazorLight.Compilation.RazorTemplateCompiler.CompileAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 84 at RazorLight.EngineHandler.CompileTemplateAsync(String key) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 51 at RazorLight.EngineHandler.CompileRenderAsync[T](String key, T model, ExpandoObject viewBag) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 131 at RazorLight.Tests.Integrational.RaceConditionTests.<>c__DisplayClass0_0.<b__0>d.MoveNext() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 26 --- End of stack trace from previous location where exception was thrown --- at RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 29 --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:00:02.2445878] RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [FAIL] X RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [1ms] Error Message: Assert.Equal() Failure ↓ (pos 1) Expected: /key Actual: /home//x10an14/Documents/github/razorlight··· ↑ (pos 1) Stack Trace: at RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Compilation/RazorTemplateCompilerTest.cs:line 60 Test Run Failed. Total tests: 135 Passed: 133 Failed: 2 Total time: 3.1843 Seconds [2019-11-28 22:43:27] 1 x10an14@x10-desktop:~/github/razorlight (permit_relative_paths $=) -> $ Test run for /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp2.0/RazorLight.Tests.dll(.NETCoreApp,Version=v2.0) Microsoft (R) Test Execution Command Line Tool Version 16.3.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. True [xUnit.net 00:00:00.9666614] RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [FAIL] X RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [126ms] Error Message: RazorLight.TemplateNotFoundException : Project can not find template with key /home//x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp2.0/template1.cshtml Stack Trace: at RazorLight.Compilation.RazorTemplateCompiler.CreateRuntimeCompilationWorkItem(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 189 at RazorLight.Compilation.RazorTemplateCompiler.OnCacheMissAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 114 at RazorLight.Compilation.RazorTemplateCompiler.CompileAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 84 at RazorLight.EngineHandler.CompileTemplateAsync(String key) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 51 at RazorLight.EngineHandler.CompileRenderAsync[T](String key, T model, ExpandoObject viewBag) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 131 at RazorLight.Tests.Integrational.RaceConditionTests.<>c__DisplayClass0_0.<b__0>d.MoveNext() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 26 --- End of stack trace from previous location where exception was thrown --- at RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 29 --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:00:02.9214654] RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [FAIL] X RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [1ms] Error Message: Assert.Equal() Failure ↓ (pos 1) Expected: /key Actual: /home//x10an14/Documents/github/razorlight··· ↑ (pos 1) Stack Trace: at RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Compilation/RazorTemplateCompilerTest.cs:line 60 Test Run Failed. Total tests: 135 Passed: 133 Failed: 2 Total time: 3.7891 Seconds Test run for /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp3.0/RazorLight.Tests.dll(.NETCoreApp,Version=v3.0) Microsoft (R) Test Execution Command Line Tool Version 16.3.0 Copyright (c) Microsoft Corporation. All rights reserved. Starting test execution, please wait... A total of 1 test files matched the specified pattern. True [xUnit.net 00:00:00.8756519] RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [FAIL] X RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test [54ms] Error Message: RazorLight.TemplateNotFoundException : Project can not find template with key /home//x10an14/Documents/github/razorlight/tests/RazorLight.Tests/bin/Debug/netcoreapp3.0/template1.cshtml Stack Trace: at RazorLight.Compilation.RazorTemplateCompiler.CreateRuntimeCompilationWorkItem(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 189 at RazorLight.Compilation.RazorTemplateCompiler.OnCacheMissAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 114 at RazorLight.Compilation.RazorTemplateCompiler.CompileAsync(String templateKey) in /home/x10an14/Documents/github/razorlight/src/RazorLight/Compilation/RazorTemplateCompiler.cs:line 84 at RazorLight.EngineHandler.CompileTemplateAsync(String key) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 51 at RazorLight.EngineHandler.CompileRenderAsync[T](String key, T model, ExpandoObject viewBag) in /home/x10an14/Documents/github/razorlight/src/RazorLight/EngineHandler.cs:line 131 at RazorLight.Tests.Integrational.RaceConditionTests.<>c__DisplayClass0_0.<b__0>d.MoveNext() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 26 --- End of stack trace from previous location where exception was thrown --- at RazorLight.Tests.Integrational.RaceConditionTests.Multiple_Simuntaneous_Compilations_RaceCondition_Test() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Integrational/RaceConditionTests.cs:line 29 --- End of stack trace from previous location where exception was thrown --- [xUnit.net 00:00:02.2275881] RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [FAIL] X RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject [< 1ms] Error Message: Assert.Equal() Failure ↓ (pos 1) Expected: /key Actual: /home//x10an14/Documents/github/razorlight··· ↑ (pos 1) Stack Trace: at RazorLight.Tests.Compilation.RazorTemplateCompilerTest.TemplateKey_Normalized_On_FilesystemProject() in /home/x10an14/Documents/github/razorlight/tests/RazorLight.Tests/Compilation/RazorTemplateCompilerTest.cs:line 60 Test Run Failed. Total tests: 135 Passed: 133 Failed: 2 Total time: 3.1976 Seconds [2019-11-28 22:43:40] 1 x10an14@x10-desktop:~/github/razorlight (permit_relative_paths $=) -> $ ```

Expected behavior

To see what I type into the prompt as soon as the execution terminates and my $PS1 is printed anew.

Actual behavior

My $PS1 is printed after execution termination, but I can't see what I type, ref. the latter half of above code-snippet.

Environment data

dotnet --info output:

```bash [2019-11-28 22:47:44] 0 x10an14@x10-desktop:~ -> $ dotnet --info .NET Core SDK (reflecting any global.json): Version: 3.0.101 Commit: bc5f8df0f5 Runtime Environment: OS Name: debian OS Version: 10 OS Platform: Linux RID: debian.10-x64 Base Path: /usr/share/dotnet/sdk/3.0.101/ Host (useful for support): Version: 3.0.1 Commit: 19942e7199 .NET Core SDKs installed: 2.2.402 [/usr/share/dotnet/sdk] 3.0.101 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download [2019-11-28 22:47:49] 0 x10an14@x10-desktop:~ -> $ ```
Additional terminal info ```bash [2019-11-28 22:51:57] 0 x10an14@x10-desktop:~/github/razorlight (permit_relative_paths $=) -> $ bash --version GNU bash, version 5.0.3(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2019 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. [2019-11-28 22:52:01] 0 x10an14@x10-desktop:~/github/razorlight (permit_relative_paths $=) -> $ gnome-terminal --version # GNOME Terminal 3.30.2 using VTE 0.54.2 +GNUTLS [2019-11-28 22:52:02] 0 x10an14@x10-desktop:~/github/razorlight (permit_relative_paths $=) -> $ echo "${PS1}" [\D{%F %T}] 0 \[\033[01;35m\]\u\[\033[00m\]@\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\e[s\e[282C\e[47D\[\033[00m\] (permit_relative_paths $=)\n-> \$ [2019-11-28 22:52:14] 0 x10an14@x10-desktop:~/github/razorlight (permit_relative_paths $=) -> $ ```
djaszczurowski commented 4 years ago

I'm having the same problem. It started to appear when we switched from .NET Core 2.2 to .NET Core 3.1 in my project.

Workaround to this is to call reset command once terminal stops displaying entered letters.

kimimaru4000 commented 3 years ago

I'm still getting this issue in .NET 5, specifically CoreCLR and CoreFX versions 5.0.321.7203 with the .NET 5.0.103 SDK.

Any status on what caused this regression and any possibility for a fix? @agocke