question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linux - Powershell 7 - linux commands should not truncate results by default

See original GitHub issue

Steps to reproduce

Run a command that will need to word wrap in your terminal:

ps aux

Expected behavior

should not truncate the commands, just like if you ran it in normal linux terminal emulator

ndipiaz+ 2473076 22.5  6.2 96664472 4094576 ?    Sl   11:48  52:03 /home/ndipiazza/Downloads/idea-IC-191.8026.42/jre64/bin/java -classpath /home/ndipiazza/Downloads/idea-IC-191.8026.42/lib/bootstrap.jar:/home/ndipiazza/Downloads/idea-IC-191.8026.42/lib/extensions.jar:/home/ndipiazza/Downloads/idea-IC-191.8026.42/lib/util.jar:/home/ndipiazza/Downloads/idea-IC-191.8026.42/lib/jdom.jar:/home/ndipiazza/Downloads/idea-IC-191.8026.42/lib/log4j.jar:/home/ndipiazza/Downloads/idea-IC-191.8026.42/lib/trove4j.jar:/home/ndipiazza/Downloads/idea-IC-191.8026.42/lib/jna.jar:/home/ndipiazza/Downloads/idea-IC-191.8026.42/jre64/lib/tools.jar -Xms128m -Xmx4750m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -XX:CICompilerCount=2 -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -Dsun.tools.attach.tmp.only=true -XX:ErrorFile=/home/ndipiazza/java_error_in_IDEA_%p.log -XX:HeapDumpPath=/home/ndipiazza/java_error_in_IDEA.hprof -Didea.paths.selector=IdeaIC2019.1 -Djb.vmOptionsFile=/home/ndipiazza/.IdeaIC2019.1/config/idea64.vmoptions -Didea.platform.prefix=Idea -Didea.jre.check=true com.intellij.idea.Main

Actual behavior

it truncated things:

ndipiaz+ 2473418  0.1  0.3 4113528 217760 ?      Sl   11:50   0:16 /home/ndipiazza/Downloads/idea-IC-191.8026.42/jre64/bin/java -Djava.awt.headless=true -Didea.version==2019.1.4 -Xmx76

This is not what a linux terminal user sees by default when using other shells. It should default to the same as any other linux terminal in this respect. This makes it harder to transition to using powershell as your main shell.

Environment data

Ubuntu + Gnome 20.04.1

Same thing happens on xterm, terminal emulator, and terminator.

Name                           Value
----                           -----
PSVersion                      7.0.3
PSEdition                      Core
GitCommitId                    7.0.3
OS                             Linux 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.10032.0, 6.0.0, 6.1.0, 6.2.0, 7.0.3}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
DHowettcommented, Aug 25, 2020

It was my understanding that ps outputs truncated text to the terminal (assuming that it can measure the width. It may not be able to during output redirection.) unless you pass w or ww. This reproduces for me on every shell on every terminal emulator I’ve used.

There may be an environment variable controlling ps’s default behavior that you’re not setting in PowerShell?

0reactions
nddipiazzacommented, Aug 25, 2020

yep - closing. thanks for the assist!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix truncated PowerShell output, even when I've ...
Pipe output to Format-Table commandlet, e.g. as follows: Get-ChildItem 'E:\' -Force -Recurse | Select-Object FullName | Format-Table - ...
Read more >
How to prevent Powershell from assuming 80 columns ...
The output in output.txt is limited to 80 columns. How can i prevent this behavior? Modifying $host.UI.RawUI.BufferSize is not supported ...
Read more >
How and why PowerShell Linux commands differ from ...
To use Linux commands in PowerShell, it's important to understand the differences between running it on Windows and Linux.
Read more >
Out-File (Microsoft.PowerShell.Utility)
Specifies the maximum number of characters in each line of output. Any additional characters are truncated, not wrapped. If this parameter isn't used,...
Read more >
Differences between Windows PowerShell 5.1 and ...
This article summarizes the differences and breaking changes from Windows PowerShell 5.1 and the current version of PowerShell that is based ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found