Score:0

How do you retain correct table width in openstack when pipeing to less?

it flag

If you set CLIFF_FIT_WIDTH=1, openstack cli will fit table output to the screen width.

However, this breaks if you try and pipe to less.

It seems like a possible workaround could be: alias openstack='openstack --max-width "$(tput cols)"' but this seems hacky. Is there a flag or env var for openstack cli I missed so that I can pipe the output to less without the width breaking?

Score:2
pt flag

The problem is that because you're piping the output to another command, the openstack CLI is no longer attached to your terminal and isn't able to query the screen width.

I usually just run openstack ... | less -S, which sort of does the opposite: it disables the wrapping of long lines so that the table displayed isn't mucked up.

Your solution of injecting the output of tput cols seems a reasonable alternative.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.