Uploading after plugging in Arduino nano_every hangs

In my project with a nano_every, platformio complains when I try to upload to the still unplugged device with the error
avrdude: jtagmkII_getsync(): sign-on command: status -1
The program hangs when I try again with the device plugged in, but only when I use the Upload button at the bottom of the window, and it produces the above error on and on. I have to restart Platformio.
BUT: Using the line “Upload and Monitot” in the lefthand column uploads without problems.

Not a big thing, but is that a bug or am I doing something wrong?

If the upload program avrdude hangs infinitely in such situations without exiting, it’s a bug in their code. You should check if it still occurs when you use the latest AVRdude 8.1 version in such situations: https://github.com/avrdudes/avrdude

PlatformIO can print you the exact upload command via project tasks → Advanced → Verbose Upload, which you can then reuse while targeting the new binary and config files, to check if it occurrs.

If yes → file a bug in avrdude.
If no → file a feature request in https://github.com/platformio/platform-atmelmegaavr/issues/ to upgrade to the latest, bugfree avrdude version.

I updated my avrdude to 8 now and will give it a try.
Thanks.

Updating to 8.1 didn’t the trick.
Using verbose upload I get the upload command

avrdude -v -p atmega4809 -C /Users/ruediheimlicher/.platformio/packages/tool-avrdude-megaavr/avrdude.conf

The avrdude-version in the tool-avrdude-megaavr-folder is from 2019, the one in the tool-avrdude-Folder is from 2023.
can I replace the old one in megaavr-folder?

Upload-problem:
I wonder why the upload runs well when I use the ‘Upload and Monitor’ item in the Project Task menu, but not when I use the upload-icon at the bottom of the window.