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

[FR] prevent GR from trying to use Qt when using terminal images #4763

Open
ExpandingMan opened this issue Jun 1, 2023 · 4 comments
Open
Labels

Comments

@ExpandingMan
Copy link

I commonly use KittyTerminalImages.jl to view images in the terminal. SixelTerm.jl works similarly.

These seem to work fine with the GR backend of Plots.jl, however, when running Plots.jl on a machine via SSH with no display I get

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb.

Aborted (core dumped)
connect: Connection refused
GKS: can't connect to GKS socket application

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS

followed by the correctly-displayed plot.

It would be really nice if there were a way to stop GR from trying to do whatever it is trying to do via Qt to eliminate this error message (and seemingly a lot of latency it causes for whatever reason) as either kitty images or sixel seem preferable for most terminal users to a separate window.

@BeastyBlacksmith
Copy link
Member

BeastyBlacksmith commented Jun 2, 2023

You can try setting the environment variable GKSwstype to nul.

And set default(display_type=:inline).

@ExpandingMan
Copy link
Author

Thanks, I'll check that out when I get a chance and close this if it works.

@ExpandingMan
Copy link
Author

Had forgotten about this, was using pythonplot to get around.

This seems to work! I did check explicitly that it requires both the environment variable and default. I think it would be nice if there were a documented, single-call way to do this.

@Vilin97
Copy link

Vilin97 commented Nov 22, 2023

I had the same issue and default(display_type=:inline) solved it for me, without setting any environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants