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

ux.table maxWidth column option #946

Closed
nickjm opened this issue Feb 9, 2024 · 4 comments
Closed

ux.table maxWidth column option #946

nickjm opened this issue Feb 9, 2024 · 4 comments
Labels
ux Related to ux module - wont fix wontfix This will not be worked on

Comments

@nickjm
Copy link

nickjm commented Feb 9, 2024

Is your feature request related to a problem? Please describe.
I would like to display long web urls in a table, which is difficult to fit in any terminal width alongside other columns. I came up with a nice solution to embed the links using terminal escape characters, for example so that only the text "link" is displayed, but a user can click on it to go to the embedded URL. However ux.table still interprets the width according to how many characters are in the raw string, including all the escape sequence characters and the hidden URL href value.

Describe the solution you'd like
Implement a maxWidth option for columns.

Describe alternatives you've considered
Respect shell escape sequences in strings when calculating width.

Additional context
Add any other context or screenshots about the feature request here.

@mdonnalley
Copy link
Contributor

@nickjm Would you be up for submitting a PR with your solution?

@mdonnalley mdonnalley added ux Related to ux module - wont fix wontfix This will not be worked on labels Mar 5, 2024
@mdonnalley
Copy link
Contributor

I'm going to close this since we've decided to remove the ux module in the next major version. There are much better dedicated libraries for generating tables in the CLI that I recommend you use instead.

@mdonnalley mdonnalley closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2024
@nrdevau
Copy link

nrdevau commented Aug 21, 2024

@mdonnalley sorry, I'm new to the node ecosystem. Can you suggest some of these CLI table libraries you are talking about? I found this by following the deprecated oclif ux codebase to here which made me think tables should be supported in oclif but I haven't seen anything about it in the docs.
As you are recommending to use others, can you please suggest at least one to look at? Would this be one? https://www.npmjs.com/package/cli-table3

Ideally I wanted to keep my 3rd party dependence graph as small as possible, but maybe that's just not a thing in modern frontend :(

@nrdevau
Copy link

nrdevau commented Aug 21, 2024

Turns out I just didn't look hard enough. it's already documented. Thanks for this tool! https://oclif.io/docs/user_experience/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux Related to ux module - wont fix wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants