resyntax
resyntax copied to clipboard
Need X to run resyntax
Similar to jeapostrophe/racket-langserver#45
$ resyntax help
Unable to init server: Could not connect: Connection refused
Gtk initialization failed for display ":0"
context...:
body of "/usr/local/stow/racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/gtk/queue.rkt"
body of "/usr/local/stow/racket-8.0/share/racket/pkgs/gui-lib/mred/private/wx/platform.rkt"
Seems you are very much aware of this state of affairs...
Yup, see #37 for some mentions of the problem to myself. Having a canonical issue for it is good though.
In summary: the problem is that Resyntax depends on DrRacket's code indenter which is entangled with the GUI framework. That's the only reason Resyntax needs a display. If we can reimplement that indenter without GUI dependencies, or extract the current implementation out into a GUI-less API, this problem goes away.
I think this might be fixable now by making Resyntax use the new syntax coloring APIs, specifically those described in syntax-color/racket-indentation.
As mentioned on that other link, there's the work-around of using xvfb-run resyntax to give it a virtual X device.
(On the one hand, this is just a work-around. On the other hand, it's something that anyone using Racket on a headless server probably will need to learn, eventually -- even if you carefully install minimal Racket, it is easy to install something that indirectly depends on gui-lib and it gets installed.)
Fixed by #236.