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

ls condensed breakpoint env variable #5542

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

cseitz
Copy link

@cseitz cseitz commented Jan 29, 2023

PM2's table incorrectly renders on nearly all of my servers because of how much information it displays and my screen doesn't have the width for it.

  • It attempts to render the full table even when the screen cannot support it; resulting in an overflow of various bars to the next line.
  • I would prefer if we could explicitly hide columns from pm2 ls, but a simple environment variable would suffice as a quick fix as condensed mode works great; just doesn't activate when I need it to.

My proposal is to add PM2_LS_CONDENSED_COLUMN_BREAKPOINT as an environment variable to specify what value is used to determine if condensed mode should be run (currently 120 is hardcoded). This would let admins define the variable globally for all users to ensure that anyone who runs pm2 ls will get the proper display mode.

  • I think an overly specific name such as this would be good because it wouldn't conflict with anything else, and it would allow you to explicitly change the behavior of only this single component of PM2.
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR https://github.com/pm2-hive/pm2-hive.github.io/pulls

PM2's table incorrectly renders on nearly all of my servers because of how much information its displays and my screen doesn't have the width for it.
- It attempts to render the full table even when the screen cannot support it; resulting in an overflow of various bars to the next line.
- I would prefer if this was updated to not be an issue at all, but a simple environment variable would suffice as a quick fix.

My proposal is to add `PM2_LS_CONDENSED_COLUMN_BREAKPOINT` as an option to specify what value is used to determine if condensed mode should be run. This would let admins define the variable globally for all users to ensure that anyone who runs `pm2 ls` will get the proper display mode.
- I think an overly specific name such as this would be good because it wouldn't conflict with anything else, and it would allow you to explicitly change the behavior of only this single component of PM2.
@CLAassistant
Copy link

CLAassistant commented Jan 29, 2023

CLA assistant check
All committers have signed the CLA.

@cseitz
Copy link
Author

cseitz commented Jan 29, 2023

process.stdout.columns = 120
image

process.stdout.columns = 119
image

This PR is just an environment variable to let one define their own breakpoint, rather than 120 (which is hardcoded)

@Unitech
Copy link
Owner

Unitech commented Mar 15, 2023

Why not, weird that pm2 does not detect correct terminal width via process.stdout.columns
Would you mind making a PR on the PM2 doc
Thank you

cseitz added a commit to cseitz/pm2-hive.github.io that referenced this pull request Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants