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

Terminal logger inserts newlines into messages #11028

Open
exyi opened this issue Nov 24, 2024 · 0 comments
Open

Terminal logger inserts newlines into messages #11028

exyi opened this issue Nov 24, 2024 · 0 comments
Labels
Priority:2 Work that is important, but not critical for the release triaged

Comments

@exyi
Copy link

exyi commented Nov 24, 2024

Issue Description

The new terminal logger inserts newlines and some whitespace padding into longer messages, such as exception from unit tests or "package downgrade detected" build errors to match the terminal window width. This causes two problems (for me):

  • Copying text from terminal now contains these additional characters, making it harder to paste file paths into other commands/editor or comparing long strings in other software.
  • I'd run dotnet test in a narrow terminal window to see how it's going and then enlarge it to read the errors. That workflow now doesn't work.

Workaround is to disable terminal logger using --tl:off option or MSBUILDTERMINALLOGGER=off env variable. That, however, looses all the other nice features of the logger.

Steps to Reproduce

Run dotnet test or dotnet build in project where long enough messages will be printed (such as stacktrace with filenames).

Then either copy-paste some text which was long enough to be line-broken, or run it a narrow window and then enlarge it.

Expected Behavior

  • Text reflows after the window resized (even when dotnet is not running anymore).
  • Copied file paths, exception messages, assert values, etc do not contain any additional characters.

-> Line breaks are not inserted into message, or there is a (documented) option to disable it. I don't know of a terminal emulator which can't break text, so I think it should be disabled by default.

Actual Behavior

Line breaks and additional whitespace characters are inserted into exception messages, stack traces and other messages.

Analysis

No response

Versions & Configurations

> dotnet msbuild -version
17.12.7.52203

> dotnet --info

.NET SDK:
 Version:           9.0.100
 Commit:            59db016f11
 Workload version:  9.0.100-manifests.c6f19616
 MSBuild version:   17.12.7+5b8665660

Runtime Environment:
 OS Name:     arch
 OS Version:  
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/9.0.100/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.0
  Architecture: x64
  Commit:       9d5a6a9aa4

.NET SDKs installed:
  6.0.135 [/usr/share/dotnet/sdk]
  7.0.120 [/usr/share/dotnet/sdk]
  8.0.110 [/usr/share/dotnet/sdk]
  9.0.100 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.35 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.35 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet]

global.json file:
  Not found

> uname -a
Linux hostname 6.6.62-1-lts #1 SMP PREEMPT_DYNAMIC Sun, 17 Nov 2024 16:35:16 +0000 x86_64 GNU/Linux
@maridematte maridematte added triaged Priority:2 Work that is important, but not critical for the release labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

2 participants