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

cmd: Proxy flag is causing WSL to open browser using x11 forwarding. Causing terminal to pause logs. #497

Closed
Huzaifa-MS opened this issue Feb 7, 2024 · 9 comments
Labels
bug Something isn't working cmd NeedsInvestigation Issue needs some investigation before being fixed

Comments

@Huzaifa-MS
Copy link

Is there any way to get output to show after using proxy flag?

templ proxy command block cli 2

It's blocking any logs from the changes I make in .templ files from showing up. I believe this is due to XDISPLAY in WSL

@joerdav joerdav changed the title Proxy flag or something similar is causing WSL to open browser using x11 forwarding. Causing terminal to pause logs. cmd: Proxy flag is causing WSL to open browser using x11 forwarding. Causing terminal to pause logs. Feb 7, 2024
@joerdav joerdav added bug Something isn't working cmd NeedsInvestigation Issue needs some investigation before being fixed labels Feb 7, 2024
@a-h
Copy link
Owner

a-h commented Feb 7, 2024

You could try using -open-browser=false to skip opening the browser automatically as a workaround.

Opening the browser is done using the https://github.com/cli/browser package, which should support the wslview command.

There's some information on the setup here: https://superuser.com/questions/1262977/open-browser-in-host-system-from-windows-subsystem-for-linux

Looking at the source code of cli/browser, it seems that it should attempt to use wslview, if it's available: https://github.com/cli/browser/blob/main/browser_linux.go

@Huzaifa-MS
Copy link
Author

Thank you for taking the time to answer. I appreciate it

@a-h
Copy link
Owner

a-h commented Feb 11, 2024

I'm not really sure of any more action to take here @Huzaifa-MS - if everyone that's using Windows will have this problem, then I'd like to "fix" it, but I don't know anything about WSL, and can't test any resolution - I only have Mac and Linux computers.

Is the "fix" to install wslview in your Virtual Machine? Not sure.

@Huzaifa-MS
Copy link
Author

Yeah sorry I should've put it into discussion maybe. Not really a templ issue. More like a VM one

@a-h
Copy link
Owner

a-h commented Feb 12, 2024

It's no problem, just wondering if there should be a docs update, eg a note to let windows users that they need to install wslview or something.

Or perhaps it's a change required upstream in the browser package to check that a desktop env is available.

@Huzaifa-MS
Copy link
Author

Not sure will let you know my results if I get it working

@Huzaifa-MS
Copy link
Author

Huzaifa-MS commented Feb 15, 2024

This issue was not due to x11 forwarding. It was due to vscode editing on windows and cli running on wsl.
I believe templ solves this by using polling. So templ files are caught. but my .go files are not.
My application built on top of templ, similar to air does not poll.
Air I believe does implement polling.

go fsnotify polling issue: fsnotify/fsnotify#603

@a-h
Copy link
Owner

a-h commented Mar 4, 2024

Ah, that's interesting. I don't use Windows. When I'm coding with people that are using WSL, I usually advise them to run everything in WSL for consistency or it gets rather confusing.

Do you think we need to do anything here, or is this something to close?

@Huzaifa-MS
Copy link
Author

My bad I did not see this. The issue is beyond the scope of the repo and fixed via using wsl and ssh vscode into it or make poller for dev environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd NeedsInvestigation Issue needs some investigation before being fixed
Projects
None yet
Development

No branches or pull requests

3 participants