Skip to content

Fix truncated package metadata in additional packages preview (#3580)#4510

Open
Softer wants to merge 1 commit intoarchlinux:masterfrom
Softer:fix-3580-pacman-info-truncation
Open

Fix truncated package metadata in additional packages preview (#3580)#4510
Softer wants to merge 1 commit intoarchlinux:masterfrom
Softer:fix-3580-pacman-info-truncation

Conversation

@Softer
Copy link
Copy Markdown
Contributor

@Softer Softer commented May 1, 2026

Fixes #3580.

Summary

pacman -S --info wraps long fields like Description across 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:

Description : most of the static HTML files that comprise this website,

After fix:

Description : most of the static HTML files that comprise this website,
including all of the SQL Syntax and the C/C++ interface specs
and other miscellaneous documentation

What changed

  • Pacman.run() gained an optional environment_vars parameter that is forwarded to SysCommand.
  • The two pacman -S --info call sites in archinstall/lib/packages/packages.py now pass {'COLUMNS': '500'}, forcing pacman to emit single-line field values.
  • AvailablePackage.info() now word-wraps each value to roughly half the terminal width using textwrap.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 --info calls; sync/install paths are unaffected.

@Softer Softer requested a review from Torxed as a code owner May 1, 2026 10:20
@h8d13
Copy link
Copy Markdown
Contributor

h8d13 commented May 1, 2026

I don't think you need the env var plumbing if you fix parser call sites

@svartkanin
Copy link
Copy Markdown
Collaborator

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

	#preview_content {
		width: 100%;
		height: auto;
	}

to the SelectListScreen class it will wrap it nicely.
I think this nees to be added conditionally though as we don't want this to be applied all the time, for example displayed tables in the preview would potentially be malformed with this.

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.

Additional packages metadata is truncated

3 participants