fix: prevent terminal hang in headless/SSH environments#142
Open
bwanswa wants to merge 4 commits intopermitio:mainfrom
Open
fix: prevent terminal hang in headless/SSH environments#142bwanswa wants to merge 4 commits intopermitio:mainfrom
bwanswa wants to merge 4 commits intopermitio:mainfrom
Conversation
Author
|
Hi @gemanor, I've rebased this fix against the latest main branch. It's ready for review. This addresses the terminal hang when running in headless/SSH environments by checking for a display environment before attempting to open a browser. Thanks! |
Implements dynamic width calculation in PolicyTables.tsx to prevent border breakage with long resource names
Author
|
I have added the dynamic table scaling fix to this PR. Please review and process the bounty through Algora. Note: I am in Uganda, so please use Payoneer for the payout. |
Collaborator
|
The login shouldn't work in a headless env., you should use the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves the issue where the permit login command causes the terminal to hang indefinitely in headless environments (e.g., SSH, Docker, or Kali Linux without a GUI).
The hang occurred because the open package attempted to launch a browser even when a graphical display was unavailable or "ghosted" (e.g., DISPLAY=:0.0 being set without an active session). I have added a non-blocking check that verifies the environment and provides a fallback URL for manual login.
Type of Change
Checklist
Additional Notes
Tested on Kali Linux (Headless).
Screenshots/Recordings
I have verified the fix using a test script that replicates the logic in source/lib/auth.ts.
UPDATE (Jan 23): Added dynamic column scaling to PolicyTables.tsx to fix border breakage and an @ts-ignore to RelationGenerator.ts for Node v22 compatibility.