Skip to content

feat(print): support STACKIT_PAGER environment variable - #1757

Open
amirthn6533 wants to merge 2 commits into
stackitcloud:mainfrom
amirthn6533:feat/1755-support-stackit-pager-env
Open

amirthn6533 wants to merge 2 commits into
stackitcloud:mainfrom
amirthn6533:feat/1755-support-stackit-pager-env

Conversation

@amirthn6533

Copy link
Copy Markdown

Summary

Closes #1755

This PR introduces support for the STACKIT_PAGER environment variable to configure the pager command specifically for the STACKIT CLI.

Changes

  • Updated PagerDisplay in internal/pkg/print/print.go to check STACKIT_PAGER first.
    • If STACKIT_PAGER is set, it is used as the pager command (taking precedence over the global PAGER).
    • If STACKIT_PAGER is unset, it falls back to PAGER.
    • If neither is set, it preserves the default less -F -S -w -R -K.
  • Added unit tests in internal/pkg/print/print_test.go (TestPagerDisplay_StackitPager) verifying precedence and fallback behavior.

Note: As a Computer Science graduate from Technical University of Sofia living in Sofia, Bulgaria, I actively follow Schwarz Digits & STACKIT's infrastructure engineering work and have applied for engineering positions at Schwarz Digits Bulgaria. Very happy to contribute to the STACKIT CLI!

Closes stackitcloud#1755

Signed-off-by: Amir Tahani <amirthn653381@gmail.com>
@amirthn6533
amirthn6533 requested a review from a team as a code owner November 18, 2026 21:12
@rubenhoenle rubenhoenle self-assigned this Nov 19, 2026
@rubenhoenle

Copy link
Copy Markdown
Member

Hi @amirthn6533

first of all thanks for your contribution!

Just FYI, I left a comment in the related issue which might be relevant for you and this contribution PR.

Best regards
Ruben from STACKIT Developer Tools Team

@rubenhoenle

Copy link
Copy Markdown
Member

Another side note, your unit tests seem to be failing :)

Signed-off-by: Amir Tahani <amirthn653381@gmail.com>
@amirthn6533

Copy link
Copy Markdown
Author

Hi @rubenhoenle,

Thank you for the quick heads-up and feedback!

I have updated the test assertion in commit aae3b45 to properly account for the trailing newline emitted by \Outputln\ during fallback, so the unit tests should now be green across the suite.

I also read your note in #1755 regarding careful investigation before introducing new environment variables to avoid workflow regressions. Totally agree that ensuring backward compatibility and long-term ergonomics comes first. Happy to adjust this implementation or hold based on what the team decides!

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.

Allow to specify pager for STACKIT cli only

2 participants