Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): when error opening a link - show it in console #1385

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

arybitskiy
Copy link
Contributor

📚 Description

When there is an error opening a link - show in CLI output

🔗 Linked Issue

🧪 Test Plan

📄 Documentation to Update

@arybitskiy arybitskiy added the bug Something isn't working label Nov 13, 2024
@arybitskiy arybitskiy self-assigned this Nov 13, 2024
Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
codemod ⬜️ Ignored (Inspect) Visit Preview Nov 14, 2024 9:35pm

Copy link

pkg-pr-new bot commented Nov 13, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/codemod@1385

commit: 8f3b6a1

@mohebifar
Copy link
Contributor

I tried the pk.pr.new build on coder terminal and still get the error.

Screenshot 2024-11-13 at 10 19 57 AM

Comment on lines 6 to 9
// Show url inside coder
if (process.env.CODER_WORKSPACE_AGENT_NAME) {
throw new Error("Cannot open browser in a headless environment");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, our problem is not with coder only. Any environment without an x-11 system will fail (e.g. most CI/CD agents). We need to just detect if x11 is missing, and skip opening altogether instead of inferring it based on a specific type of agent (coder).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rechecked everything - open does work in coder env, but this should be installed sudo apt install xdg-utils.
The problem was with keytar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants