Is there a way to preview image files when they are clicked in the file explorer?

We have students who are using Theia that instinctively click the image files in the navigator expecting them to open as a preview, however they are met with a dialog that says:

The file is either binary or uses an unsupported text encoding.

Opening it might take some time and might make the IDE unresponsive. 
Do you want to open 'assets/bomb.png' anyway?

This can be fairly confusing, as one would intuitively expect that the image would “just open”.

Is there a way to have the image open as a preview instead of the text editor?

@bendavis thank you for the discussion.

If you’d like to open the resource directly from the navigator/explorer as a preview, you can use the additional openers, namely preview (given your application includes @theia/mini-browser):


For the use-case where the preview is opened for images by default in the navigator, there is an open issue tracking the bug:

If you’d like to see which filetypes are handled as images here is the sources: