In "Expert" mode PrusaSlicer has an option in the "Printer Settings" tab to activate previews. Under General / Firmware, enter 32x32/PNG,400x300/PNG as "G-code thumbnails".
Printer Settings > General > Firmware (since v2.7.0)
Thumbnail (since v2.3.0)
Enable Exclude Object
In PrusaSlicer you have to select Firmware-specific in:
Enable advanced or expert mode and change the options under Printer Settings > General as shown in the screenshot below. A “Physical Printer” must be configured in Printer Settings > General.
Best practise G-codes
These custom G-codes are necessary to get the best user experience.
Layer Count
To have Slicer layer counts in Mainsail, you have to add these two G-codes in your custom G-codes in PrusaSlicer: