Fix truncated package metadata in additional packages preview (#3580)#4510
Fix truncated package metadata in additional packages preview (#3580)#4510Softer wants to merge 4 commits intoarchlinux:masterfrom
Conversation
|
I don't think you need the env var plumbing if you fix parser call sites |
|
I don't think truncated is the right description for this as it's not truncated but horizontally scrollable. This can also be solved much simpler with CSS to do text wrap, if you add this to the |
|
It makes sense... Let's try :) |
|
The snipplet I provided was an example and as mentioned it needs to be conditionally applied as we don't want to have that for every preview as that will malform tables. Have a look at this example code https://github.com/Softer/archinstall/blob/5136b3190d9d8c6d137fc060dbc774e0263a0839/archinstall/tui/ui/components.py#L881 |
|
Addressed: CSS wrap is now conditional via wrap_preview parameter. Only the packages menu enables it - other previews with tables are unaffected. |
Fixes #3580.
Summary
pacman -S --infowraps long fields likeDescriptionacross multiple lines when the pty width is small (default 80 cols). archinstall's package info parser pre-stripped each output line before joining continuations, which discarded the leading whitespace it relied on to detect continuation lines, so the wrapped portions were silently dropped.Example before fix, for
sqlite-doc:After fix:
What changed
Pacman.run()gained an optionalenvironment_varsparameter that is forwarded toSysCommand.pacman -S --infocall sites inarchinstall/lib/packages/packages.pynow pass{'COLUMNS': '500'}, forcing pacman to emit single-line field values.AvailablePackage.info()now word-wraps each value to roughly half the terminal width usingtextwrap.fill, so the preview pane does not get a horizontal scrollbar on long fields. The continuation lines are aligned to the value column to match pacman's own visual style.Scope is limited to
-S --infocalls; sync/install paths are unaffected.