Unlike 1.8.19, 2.3.6 cannot open image file links?

Started using the latest version in earnest today, as it has several attractions. But my hope to make it my regular IDE is dwindlingt. Apart from my major gripe (no separate serial monitor window) I'm encountering various quirks. For instance, this post is to complain that: in 1.8.19 I often included a commented link to a JPG, but that is now rejected, as binary.

Can you give an example of the comment that you put in the code? Blank sketch with comment inserted should do.

Hi @Terrypin. You can add support for images to Arduino IDE by installing Microsoft's "Media Preview" VS Code extension. I'll provide instructions you can follow to do that:


:warning: The Arduino company does not provide official support for use of 3rd party extensions with Arduino IDE, so this is very much an "at your own risk" thing.


  1. Click the following link to open the Open VSX Registry listing for the "Media Preview" extension in your web browser:
    https://open-vsx.org/extension/vscode/media-preview

  2. Click the "DOWNLOAD" button at the right side of the page.
    The web browser will start a file download.

  3. Wait for the download to finish.

  4. Create a folder named plugins under Arduino IDE's configuration folder:

    • Windows:
      C:\Users\<username>\.arduinoIDE\
      
      (where <username> is your Windows username)
    • Linux:
      ~/.arduinoIDE/
      
      :red_exclamation_mark: The .arduinoIDE folder is hidden by default in the file manager and terminal.
    • macOS:
      ~/.arduinoIDE/
      
      :red_exclamation_mark: The .arduinoIDE folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.
  5. Copy the downloaded .vsix file to the plugins folder you created.

  6. If Arduino IDE is running, select File > Quit from the Arduino IDE menus to exit all windows.

  7. Start Arduino IDE.

Now when you open a file schema link to an image file from a comment in your sketch code, the image will open in a tab in the Arduino IDE editor.

// file:///E:/foo.png

You can open the URI either by holding the Ctrl key (Cmd for macOS users), then clicking on the comment, or else hover the mouse pointer over it until a tooltip appears, then clicking the "Follow link" link in the tooltip.

Thanks. Now I see what Terrypin is referring to; I thought that he meant that the code would not compile.

I get this:

And it's impossible to close the dialog without clicking "Yes". Is that a known bug?

I also noticed that, but I was able to close it by clicking the "NO" button four times.

No way on my system (Windows 11 home, IDE 2.3.6 zip install, 300kB png file).

Single clicking anywhere in that line immediately displayed this helpful image on my pc:

Various purposes but especially useful for schematics and pin layouts.

Note that when using Arduino IDE 2.x you must do a Ctrl + click instead of only clicking. I think that once you get used to it, you might actually find you prefer this because it avoids accidentally opening links when you are actually only trying to work with the code in the editor.

I was using Ctrl click. At least after discovering that the familiar single click didn't work. That Ctrl click gave the error message. Strangely, trying again now, I get no action at all!
It's late, I'll look again in the morning.

Meanwhile, I don't understand the radical change? After all, many sketches use a link to show the author or source?

Did you follow the instructions I provided in post #3? If not, just follow those instructions and I think you will be happy.

I don't think it is fair to call it a "radical change". As far as I am aware, you are the first person to report this after 4.5 years of the community using Arduino IDE 2.x. Most users probably aren't even aware of the existence of file schema URIs.

Web links work just fine.

It is only when loading local files in a binary format for which Arduino IDE doesn't have native support that you will encounter a problem.

Do you mean after implementing the rather complex extension you described?

Installing, not "implementing", but yes after you install that extension Ctrl+clicking on a file schema link to an image file will cause it to load in an Arduino IDE editor tab.

Ah, OK, hadn’t appreciated that. I can change my approach fairly easily.

Moving the serial monitor from the bottom to the side works a lot better on a PC with widescreen monitor.That (almost) cures that problem.

I still keep a copy of 1.8.19 on my PC.
Right-click on an ino file, and you can choose with which IDE you open it.
The square (new) or round (old) icon makes it easy to choose.
Leo..

In case you are interested in giving this a try @Terrypin, I provide instructions here:

If I feel the need for a separate Serial monitor I open a second instance of the IDE associated with the same board and port and open the Serial monitor of that instance

Thanks. I did try the alternative and agree it gets a bit closer to my familiar layout. I'm also going to try @UKHeliBob 's two instances.

I should mention a more general factor about updating my IDE. I make widespread use of Macro Express Pro to imnprove productivity across all my apps. I see 36 of my thousand or two macros are scoped to Arduino. Of those some will need rewriting for IDE 2.3.6. Probably those that with KB shortcuts NumPad 1, 2, 3 arrange up to three editing windows vertically alongside each other.

Workflow familiarity and muscle memory are always reasons causing hesitation when apps make major UI changes, but magnified by my investment in macros.

I currenty have both icons in my taskbar and when project activity eases up I'll do some further comparisons.

You’re right, Arduino IDE 2.3.6 blocks image file links in comments, it treats them as binary and won’t open them. This didn’t happen in 1.8.19. It’s likely for stability, but it breaks that workflow. If you need images, just use plain URLs or stick with 1.8.19.

@Terrypin is not the first person to report an issue with uri links to local files.
And I too thought it was a pretty big regression.
My libraries used local html documentation and not supporting local links broke all that. - It is still broken.

I reported it as soon as 2.x was in Beta.
I reported it for links to local html files.
(I looked but could not find the issue I created for this)

The original 2.x problem I reported was that the 2.x IDE couldn't find the referenced file because it wasn't properly referencing the local path correctly.
i.e. you got file not found errors.

I went round and round with you guys and finally just gave up as Arduino.cc didn't seem to see supporting local file links as a priority.
More recently the path issue was resolved and the local files could be found but the IDE doesn't handle the files properly.
Example, for html files, the IDE simple pulls and displays the the raw html text instead of handing the path to html file to the users browser to render.

My suggestion was and still is for local URI links, like file:// to just fire up the users web browser and let the users web browser handle it like 1.x did.
i.e. pass the path to the linked file to the users web browser
That way all the file types would be handled appropriately and according the users personal preferences he configured in his browser.
It would be a one and done for the Arduino.cc developers.
They could fix it and the issue to bed.

--- bill

You reported a different problem: